npm 错误!代码 ELIFECYCLE(起始问题) [英] npm ERR! code ELIFECYCLE (starting issue)

查看:189
本文介绍了npm 错误!代码 ELIFECYCLE(起始问题)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

感谢您阅读本文并帮助解决此问题.

我正在尝试在 Windows 机器上运行 nodejs 并在安装 expo-cli 后启动 expo 客户端.最初它有效,只是实时刷新或任何其他刷新都不起作用,所以我尝试再次删除、卸载/重新安装 nodejj,现在我根本无法启动它.

我已经尝试了以下故障排除步骤:npm ERR!代码生命周期

但不幸的是他们根本没有帮助......

我不知道是否有办法执行全新安装,因为它可能保存在缓存中的某处(即使我完全删除了目录).我对这里的任何建议持开放态度.

提前感谢您的所有回答和评论.

这是cli的错误:

C:\Users\Sergej\NewProject>npm start>@ 开始 C:\Users\Sergej\NewProject>博览会开始在 C:\Users\Sergej\NewProject 启动项目Expo DevTools 运行在 http://localhost:19002在浏览器中打开 DevTools...(按 shift-d 禁用)错误 无效的正则表达式:/(.*\\__fixtures__\\.*|node_modules[\\\]react[\\\]dist[\\\].*|website\\node_modules\\.*|heapCapture\\bundle\.js|.*\\__tests__\\.*)$/:未终止的字符类.使用 --verbose 标志运行 CLI 以获取更多详细信息.Metro Bundler 进程退出,代码为 1在您的环境中设置 EXPO_DEBUG=true 以查看堆栈跟踪.npm 错误!代码生命周期npm 错误!错误号 1npm 错误!@开始:`博览会开始`npm 错误!退出状态 1npm 错误!npm 错误!@start 脚本失败.npm 错误!这可能不是 npm 的问题.上面可能有额外的日志输出.npm 错误!可以在以下位置找到此运行的完整日志:npm 错误!C:\Users\Sergej\AppData\Roaming\npm-cache\_logs\2019-10-31T16_44_26_903Z-debug.log

这是日志文件文本:

0 info 如果它以 ok 结尾,它就起作用了1个详细的cli [1 详细的 cli 'C:\\Program Files\\nodejs\\node.exe',1 详细 cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',1个详细的cli开始"1个详细的cli]2 信息使用 npm@6.12.03 信息使用 node@v12.13.04 详细的运行脚本 ['prestart', 'start', 'poststart']5 信息生命周期@~预启动:@6 info 生命周期@~start:@7 冗长的生命周期@~start: unsafe-perm in lifecycle true8 详细生命周期@~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Sergej\NewProject\node_modules\.bin;C:\Users\Sergej\AppData\Roaming\npm;C:\Program Files\nodejs\;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Users\Sergej\AppData\Local\Microsoft\WindowsApps;C:\Users\Sergej\AppData\Roaming\npm9 详细生命周期@~start: CWD: C:\Users\Sergej\NewProject10 愚蠢的生命周期@~start: Args: [ '/d/s/c', 'expo start' ]11 愚蠢的生命周期@~start:返回:代码:1 信号:空12 info生命周期@~start: 执行启动脚本失败13 详细堆栈错误:@start:`expo start`13 详细堆栈退出状态 113 EventEmitter 上的详细堆栈.(C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)EventEmitter.emit 上的 13 个详细堆栈 (events.js:210:5)13 ChildProcess 中的详细堆栈.(C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)ChildProcess.emit 上的 13 个详细堆栈 (events.js:210:5)13 详细堆栈在可能关闭 (internal/child_process.js:1021:16)13 Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) 的详细堆栈14 详细 pkid @15 详细 cwd C:\Users\Sergej\NewProject16 详细 Windows_NT 10.0.1836217 详细 argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"18 详细节点 v12.13.019 冗长的 npm v6.12.020 错误代码 ELIFECYCLE21 错误 errno 122 错误@开始:`expo start`22 错误退出状态 123 错误 @start 脚本失败.23 错误 这可能不是 npm 的问题.上面可能有额外的日志输出.24 详细退出 [ 1, true ]

解决方案

因此,在花费了大量时间试图解决问题之后(通常我发现的所有步骤都涉及以一种或另一种方式重新安装依赖项)我找到了答案.

事实证明,最新的 node.js 问题与 Windows 有一些问题,对我来说解决这个问题的唯一方法是下载以前的版本.我是从以下地址下载的:

https://nodejs.org/en/download/releases/

为我修复它的版本是 Node.js 10.x

快速无痛(几乎)

我希望这能帮助那些遇到类似问题的人......

thanks for reading this and helping with the issue.

I am trying to run nodejs on Windows machine and start expo client after installing expo-cli. Initially it worked except that live refresh or any other refresh wouldn't work so I tried to delete, uninstall/reinstall nodejj again and now I can't start the thing at all.

I've tried troubleshooting steps from here: npm ERR! code ELIFECYCLE

but unfortunately they did not help at all...

I don't know if there is a way to perform a fresh install as it may be something that is saved somewhere in cache (even if I delete the directory completely). I'm open to any suggestions here.

Thanks a mil in advance for all your answers and comments.

This is the error from cli:

C:\Users\Sergej\NewProject>npm start

> @ start C:\Users\Sergej\NewProject
> expo start

Starting project at C:\Users\Sergej\NewProject
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
Set EXPO_DEBUG=true in your env to view the stack trace.
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\Sergej\AppData\Roaming\npm-cache\_logs\2019-10-31T16_44_26_903Z-debug.log

This is the log file text:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start'
1 verbose cli ]
2 info using npm@6.12.0
3 info using node@v12.13.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle @~prestart: @
6 info lifecycle @~start: @
7 verbose lifecycle @~start: unsafe-perm in lifecycle true
8 verbose lifecycle @~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Sergej\NewProject\node_modules\.bin;C:\Users\Sergej\AppData\Roaming\npm;C:\Program Files\nodejs\;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Users\Sergej\AppData\Local\Microsoft\WindowsApps;C:\Users\Sergej\AppData\Roaming\npm
9 verbose lifecycle @~start: CWD: C:\Users\Sergej\NewProject
10 silly lifecycle @~start: Args: [ '/d /s /c', 'expo start' ]
11 silly lifecycle @~start: Returned: code: 1  signal: null
12 info lifecycle @~start: Failed to exec start script
13 verbose stack Error: @ start: `expo start`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:210:5)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:210:5)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid @
15 verbose cwd C:\Users\Sergej\NewProject
16 verbose Windows_NT 10.0.18362
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.13.0
19 verbose npm  v6.12.0
20 error code ELIFECYCLE
21 error errno 1
22 error @ start: `expo start`
22 error Exit status 1
23 error Failed at the @ start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

解决方案

So, after spending ridiculous amount of time trying to solve the issue (generally all the steps that I've found were involving reinstalling dependencies in one way or another) I've found the answer.

It turns out that the latest node.js issue has some issues with Windows and the only way to fix this for me was to download previous version. I've downloaded it from:

https://nodejs.org/en/download/releases/

the version that fixed it for me was Node.js 10.x

Quick and painless (almost)

I hope that this will help someone who will be stuck with a similar issue...

这篇关于npm 错误!代码 ELIFECYCLE(起始问题)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆