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! demo@0.0.1 start: `node node_modules/react-native/local-cli/cli.js start`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the demo@0.0.1 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__\/.*/

];

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容