This error normally happens if you have deleted your node_modules.
If you use yarn for installing your dependencies (you will have a file called yarn.lock in that case), run yarn to recreate node_modules.
If you use npm for installing your dependencies (you will have a file called package-lock.json in that case), run npm install to recreate node_modules.
If you have both yarn.lock and package-lock.json then you have previously run both yarn and npm install to install dependencies. You should pick one to use going forward and delete the other tool’s lock file.
After running yarn or npm install you should no longer get this error message.
I use npm - I ran npm install but it didnt fix anything. I even deleted node-modules because obviously I did not delete it in the first place and ran npm install but again it did not help… I really need a fix for this i asked on stackoverflow and on github but nobody could help me either… I need to write this app while I am at work so a fix would be appreciated!
Alright I fixed it by myself. Even though I had the newest cli I had to upgrade it again and then I had to change the blacklist.js file located in node-modules/metro-config/src/defaults/blacklist.js to this:
var sharedBlacklist = [
/node_modules[\/\\]react[\/\\]dist[\/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];
Interesting. There was a bug triggered by node 13.x on Windows a while ago also to do with regular expressions, but I thought that was fixed these days. And that one did complain about the regular expression in the error message if I remember correctly.