Header Ads Widget

Ticker

6/recent/ticker-posts

React Native CLI error: Invalid regular expression: /(.*\\__fixtures__

 Sample error:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
D:\VueNative\demo>npm start
 
> demo@0.0.1 start D:\VueNative\demo
> 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 detai
ls.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! demo@0.0.1 start: `node node_modules/react-native/local-cli/cli.js star
t`
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 log
ging output above.
 
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-12-04T0
3_38_09_097Z-debug.log

NodeJS version: v14.7.0

Solution: Edit file node_modules\metro-config\src\defaults\blacklist.js

Line 14-19

1
2
3
4
5
6
var sharedBlacklist = [
  /node_modules[/\\]react[/\\]dist[/\\].*/,
  /website\/node_modules\/.*/,
  /heapCapture\/bundle\.js/,
  /.*\/__tests__\/.*/
];

Change to:

1
2
3
4
5
6
var sharedBlacklist = [
  /node_modules[\/\\]react[\/\\]dist[\/\\].*/,
  /website\/node_modules\/.*/,
  /heapCapture\/bundle\.js/,
  /.*\/__tests__\/.*/
];

Done

Publicar un comentario

0 Comentarios