React native 使用Expo进行本机反应:错误:Metro捆绑程序进程已退出,代码为1
我正在尝试使用expo在react中运行示例程序 我使用了:React native 使用Expo进行本机反应:错误:Metro捆绑程序进程已退出,代码为1,react-native,React Native,我正在尝试使用expo在react中运行示例程序 我使用了:E:\ReactNative\Samples\rn starter>npm start 我收到错误信息: > @ start E:\ReactNative\Samples\rn-starter > expo start Starting project at E:\ReactNative\Samples\rn-starter Expo DevTools is running at http://localhost:1900
E:\ReactNative\Samples\rn starter>npm start
我收到错误信息:
> @ 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\xdl@56.8.0\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
@start E:\ReactNative\Samples\rn starter
>世博会开幕
正在E:\ReactNative\Samples\rn starter启动项目
Expo DevTools正在运行http://localhost:19002
正在浏览器中打开DevTools。。。(按shift-d键禁用)
错误无效的正则表达式:/(.\\\\\\\\\\\\\.\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\]dist[\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\.$/:未终止字符类。有关详细信息,请使用--verbose标志运行CLI。
Metro捆绑程序进程已退出,代码为1
错误:Metro捆绑程序进程已退出,代码为1
在这个过程中。(C:\@世博会\xdl@56.8.0\src\Project.ts:1834:16)
在Object.onceWrapper(events.js:300:26)
在ChildProcess.emit上(events.js:210:5)
在Process.ChildProcess.\u handle.onexit(内部/child\u Process.js:272:12)
npm错误!代码失效循环
npm错误!错误1
npm ERR!@开始:`世博会开始`
npm错误!退出状态1
npm错误!
npm错误!在@start脚本中失败。
npm错误!这可能不是npm的问题。上面可能还有其他日志输出。
npm错误!此运行的完整日志可在以下位置找到:
npm错误!C:\Users\Devrath\AppData\Roaming\npm cache\\u logs\2019-11-20T08\u 48\u 21\u 094Z-debug.log
我也遇到了同样的问题,当我将Node.Js版本更新到12.13.1时,似乎是在解释正则表达式时出错了: 选项1:
> @ 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\xdl@56.8.0\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
在您的项目中,转到
\node\u modules\metro config\src\defaults\blacklist.js
更改:
var sharedBlacklist = [
/node_modules[/\\]react[/\\]dist[/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];
到
选项2:
> @ 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\xdl@56.8.0\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
将Node.js版本降级至12.9或更高版本
希望这对您有所帮助。您正在运行哪个版本的expo cli?还可以尝试
expo start-c