首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >‘`npm’提供生命周期错误,状态为9的退出

‘`npm’提供生命周期错误,状态为9的退出
EN

Stack Overflow用户
提问于 2021-12-20 09:42:48
回答 1查看 2.4K关注 0票数 0

到目前为止,我看过类似的问题,如this issuethis one。解决办法似乎是:

代码语言:javascript
复制
rm package-lock.json
npm cache clean --force
npm install
npm start

我已经尝试过这些步骤,但是仍然会出现同样的错误:

代码语言:javascript
复制
> client@0.1.0 start /home/ubuntu/react/client
> react-scripts --openssl-legacy-provider start

/usr/bin/node: bad option: --openssl-legacy-provider
npm ERR! code ELIFECYCLE
npm ERR! errno 9
npm ERR! client@0.1.0 start: `react-scripts --openssl-legacy-provider start`
npm ERR! Exit status 9
npm ERR!
npm ERR! Failed at the client@0.1.0 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!     /home/ubuntu/.npm/_logs/2021-12-20T09_28_07_369Z-debug.log

/home/ubuntu/.npm/_logs/2021-12-20T09_28_07_369Z-debug.log的输出是:

代码语言:javascript
复制
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using npm@6.14.8
3 info using node@v12.18.2
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle client@0.1.0~prestart: client@0.1.0
6 info lifecycle client@0.1.0~start: client@0.1.0
7 verbose lifecycle client@0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle client@0.1.0~start: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/ubuntu/react/client/node_modules/.bin:/home/ubuntu/.virtualenvs/react/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ubuntu/go/bin
9 verbose lifecycle client@0.1.0~start: CWD: /home/ubuntu/react/client
10 silly lifecycle client@0.1.0~start: Args: [ '-c', 'react-scripts --openssl-legacy-provider start' ]
11 silly lifecycle client@0.1.0~start: Returned: code: 9  signal: null
12 info lifecycle client@0.1.0~start: Failed to exec start script
13 verbose stack Error: client@0.1.0 start: `react-scripts --openssl-legacy-provider start`
13 verbose stack Exit status 9
13 verbose stack     at EventEmitter.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid client@0.1.0
15 verbose cwd /home/ubuntu/react/client
16 verbose Linux 5.8.0-63-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v12.18.2
19 verbose npm  v6.14.8
20 error code ELIFECYCLE
21 error errno 9
22 error client@0.1.0 start: `react-scripts --openssl-legacy-provider start`
22 error Exit status 9
23 error Failed at the client@0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 9, true ]

我看到的所有帖子似乎都有1的退出状态,而我却有9的退出状态。问题是什么?从我所读到的情况来看,退出状态9意味着进程正在被系统杀死,但我不知道为什么或者如何找出答案。

EN

回答 1

Stack Overflow用户

发布于 2022-06-07 11:10:55

如果由于任何原因(例如,没有管理权限或其他原因),无法在用户的计算机上进行节点升级,那么我发现这修复了它:更改参数出现在命令中的位置,所以在package.json中,而不是这样:

"start": "react-scripts --openssl-legacy-provider start"

这样做:

"start": "react-scripts start --openssl-legacy-provider"

来源:https://github.com/coreui/coreui-free-react-admin-template/issues/336

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70419935

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档