react-native start 报错,react native 服务启动失败解决办法

npx react-native 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.
\node_modules\metro-config\src\defaults\blacklist.js

打开下列文件:


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

进行内容替换后可以成功开启react-native 服务 

 

猜你喜欢

转载自blog.csdn.net/loveseal518/article/details/122976000
今日推荐