Devrath
Devrath

Reputation: 42854

React Native using Expo : Error: Metro Bundler process exited with code 1

I am trying to run a sample program in react using expo

I used: E:\ReactNative\Samples\rn-starter>npm start

I am getting error :

> @ start E:\ReactNative\Samples\rn-starter
> expo start

Starting project at E:\ReactNative\Samples\rn-starter
Expo DevTools is running at http://localhost:19002
Opening DevTools in the browser... (press shift-d to disable)
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.

Metro Bundler process exited with code 1
Error: Metro Bundler process exited with code 1
    at ChildProcess.<anonymous> (C:\@expo\[email protected]\src\Project.ts:1834:16)
    at Object.onceWrapper (events.js:300:26)
    at ChildProcess.emit (events.js:210:5)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: `expo start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ 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\Devrath\AppData\Roaming\npm-cache\_logs\2019-11-20T08_48_21_094Z-debug.log

Upvotes: 0

Views: 1496

Answers (1)

Tuki
Tuki

Reputation: 91

I had the same issue, it happened when i updated the Node.Js version to 12.13.1, it seems that it's an error in the interpretation of a regular expression:

Option N° 1 :

Inside your project go to

\node_modules\metro-config\src\defaults\blacklist.js

Change :

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

To

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

Option N° 2:

Downgrade your Node.js version to 12.9 or older

Hope this will help you.

Upvotes: 1

Related Questions