react-native start giving Invalid regular expression invalid error react-native start giving Invalid regular expression invalid error reactjs reactjs

react-native start giving Invalid regular expression invalid error


There is a problem with Metro using some NPM and Node versions.

You hay 2 alternatives:


  • Alternative 2: Go to a file in your npde_modules folder: \node_modules\metro-config\src\defaults\blacklist.js and change this code:
var sharedBlacklist = [  /node_modules[/\\]react[/\\]dist[/\\].*/,  /website\/node_modules\/.*/,  /heapCapture\/bundle\.js/,  /.*\/__tests__\/.*/];

to this:

var sharedBlacklist = [  /node_modules[\/\\]react[\/\\]dist[\/\\].*/,  /website\/node_modules\/.*/,  /heapCapture\/bundle\.js/,  /.*\/__tests__\/.*/];

Please note that if you run npm install or yarn install you'll need to change the code again.


Its compatibility issue of NodejsI uninstalled my Node(12.11) and installed Node(10) stable version and it worked perfectly.


A similar question was asked here may be this solution might work for you cause i applied and it worked