React native 如何修复以代码1退出的Metro Bundler进程

React native 如何修复以代码1退出的Metro Bundler进程,react-native,expo,metro-bundler,React Native,Expo,Metro Bundler,如何修复以代码1退出的Metro Bundler进程 Metro“Bundler”进程已退出,代码为1 Error: Metro 'Bundler' process exited with code 1 at 'ChildProcess' .<anonymous> (C:\@expo\xdl@56.6.0\'src'\Project.ts:1841:16) at Object.onceWrapper (events.js:300:26) at ChildPr

如何修复以代码1退出的Metro Bundler进程 Metro“Bundler”进程已退出,代码为1

Error: Metro  'Bundler' process exited with code 1
    at 'ChildProcess' .<anonymous> (C:\@expo\xdl@56.6.0\'src'\Project.ts:1841: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)
 ERR! code     ELIFECYCLE
 ERR! err no 1
 ERR! @ start: `expo start`
 ERR! Exit status 1
 ERR!
 ERR! Failed at the @ start script.
ERR! This is probably not a problem with npm. There is likely additional logging output above.

 ERR! A complete log of this run can be found in:
 ERR!     C:\Users\Pranav\AppData\Roaming\npm-cache\_logs\2019-11-08T04_33_07_234Z-debug.log
错误:Metro“Bundler”进程已退出,代码为1
在“儿童过程”中。(C:\@世博会\xdl@56.6.0\“src'\Project.ts:1841:16)
在Object.onceWrapper(events.js:300:26)
在ChildProcess.emit上(events.js:210:5)
在Process.ChildProcess.\uhandle.onexit(内部/child\u
进程(js:272:12)
犯错误代码失效循环
犯错误错误1
呃!@开始:`世博会开始`
犯错误退出状态1
犯错误
犯错误在@start脚本中失败。
犯错误这可能不是npm的问题。上面可能还有其他日志输出。
犯错误此运行的完整日志可在以下位置找到:
犯错误C:\Users\Pranav\AppData\Roaming\npm cache\\u logs\2019-11-08T04\u 33\u 07\u 234Z-debug.log

如果您在windows上运行,您可以在github上尝试此线程中提供的解决方案

github提供的似乎有效的解决方案:

Got this issue today on windows, but don't need to downgrade node, just as discussed on stackoverflow just need to change some hashes on your project:

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

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

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

我通过删除文件夹解决了这个问题: C:\Users\bunty\AppData\Roaming\npm并删除npm文件夹。 然后在cmd(管理员)中键入命令npm install-g expo cli。
如果仍然不起作用,请尝试使用较低版本的node(12.9.0)。

也有同样的问题,并通过将我的nodejs版本从12.13.1降低到12.9.1来修复

有关更多详细信息,请访问github线程:

看起来node js的版本(12.13.1)有问题。它适用于旧版本12.9.1


我有一个类似的问题,所以我卸载了这个版本并安装了旧版本。这解决了metro bundler问题。

如何解决错误:metro bundler进程已退出,代码为1Nice one,谢谢。谢谢。为什么不接受此答案?错误仍然发生bro
错误:未知选项
--AssetText的Metro捆绑程序进程已退出,代码为1`欢迎使用堆栈溢出!这与YAcine Mathurin一周前发布的答案基本相同。@Rohan Devaki卸载当前版本,重新启动计算机,然后选择要安装的版本。我在windows上,所以为了简单起见,我使用了相应版本的扩展msi。