gpt4 book ai didi

node.js - npm 错误!代码 ELIFECYCLE(起始问题)

转载 作者:太空宇宙 更新时间:2023-11-04 01:22:56 28 4
gpt4 key购买 nike

感谢您阅读本文并帮助解决该问题。

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

我已尝试从此处执行故障排除步骤:npm ERR! code ELIFECYCLE

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

我不知道是否有办法执行全新安装,因为它可能保存在缓存中的某处(即使我完全删除目录)。我愿意接受任何建议。

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

这是来自 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

这是日志文件文本:

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 ]

最佳答案

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

事实证明,最新的 node.js 问题在 Windows 上存在一些问题,对我来说解决此问题的唯一方法是下载以前的版本。我从以下位置下载的:

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

为我解决这个问题的版本是 Node.js 10.x

快速且无痛(几乎)

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

关于node.js - npm 错误!代码 ELIFECYCLE(起始问题),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58648120/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com