I just installed node.js & cli
installed react-native-cli
npm -g react-native-cli
On windows 10 i highly recommend to install Linux Bash Shell.
Here is a nice guide to set it up: https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/
just follow the steps, choose your linux distribution and avoid as much possible to work with node on cmd since obvious instability.
Take in consideration Microsoft strongly warns against adding or modifying Linux files with Windows software, as described here: howtogeek.com/261383/how-to-access-your-ubuntu-bash-files-in-windows-and-your-windows-system-drive-in-bash/
Hope it helps!
I have just update package.json to change from
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz"
to
"react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz"
It seems that the problem won't occur in sdk-36 !!
My node version is v12.16.0 and os is win10.
You can go to...
\node_modules\metro-config\src\defaults\blacklist.js and change...
var sharedBlacklist = [ /node_modules[/\\]react[/\\]dist[/\\].*/,
/website\/node_modules\/.*/, /heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/ ];
for this:
var sharedBlacklist = [
/node_modules[\/\\]react[\/\\]dist[\/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];
I just got a similar error for the first time today. It appears in \node_modules\metro-config\src\defaults\blacklist.js
, there is an invalid regular expression that needed changed. I changed the first expression under sharedBlacklist
from:
var sharedBlacklist = [
/node_modules[/\\]react[/\\]dist[/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];
to:
var sharedBlacklist = [
/node_modules[\/\\]react[\/\\]dist[\/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];
I have found that in pretty older project there is no metro-config
in node_modules
. If it is the case with you, then,
Go to node_modules/metro-bundler/src/blacklist.js
And do the same step as mentioned in other answers, i.e.
Replace
var sharedBlacklist = [
/node_modules[/\\]react[/\\]dist[/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];
with
var sharedBlacklist = [
/node_modules[\/\\]react[\/\\]dist[\/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];
P.S. I faced the same situation in a couple of projects so thought sharing it might help someone.
Edit
As per comment by @beltrone the file might also exist in,
node_modules\metro\src\blacklist.js
Fix it by install metro-config of the latest version (0.57.0 for now) they had fixed the problem:
npm install metro-config
you can remove it later, after react-native guys update module versions