ict.ken.be

Delivering solid user friendly software solutions since the dawn of time.

npx react-native start gives invalid regular expression

Categories: Nodejs Reactjs

Most likely your 'node_modules\metro-config\src\defaults\blacklist.js' has an invalid regular expression.

You can correct it with the expression below

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

However, it's more likely that you just downloaded an older react-native example and are trying to run this with a different version than intended.

You could ensure that you install all the package.json dependencies fixed to the version the example was build with.

Or you could upgrade all packages to their latest version and fix any issues that might come from that.

At least with the second option you are ready to go with all the latest tools.