React Native 报错 提示node 版本过高

node node_modules/react-native/local-cli/cli.js start

error Invalid regular expression: /(.*\\__fixtures__\\.*|node_modules[\\\]react[\\\]dist[\\\].*|website\\node_modules\\.*|heapCapture\\bundle\.js|.*\\__tests__\\.*)$/: Unterminated character class. Run CLI with --verbose flag for more details.

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! [email protected] start: `node node_modules/react-native/local-cli/cli.js start`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the [email protected] start script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm ERR!    C:\Users\pc\AppData\Roaming\npm-cache\_logs\2020-04-01T05_58_36_248Z-debug.log

解决办法:

修改node_modules\metro-config\src\defaults\blacklist.js文件

var sharedBlacklist = [

  /node_modules[\/\\]react[\/\\]dist[\/\\].*/,

  /website\/node_modules\/.*/,

  /heapCapture\/bundle\.js/,

  /.*\/__tests__\/.*/

];

你可能感兴趣的:(React Native 报错 提示node 版本过高)