node升级新版本后启动应用每次不能正常退出

发布于 2022-09-07 21:01:13 字数 3171 浏览 11 评论 0

之前使用nodev6.x,今天升级8版本,因为是window就直接msi覆盖安装,出现一下问题:
没有安装守护之类的像pm2,forever,第一次启动npm start,应用正常,关闭终端,再次启动npm start会报错如下:


> app@0.0.0 start C:\Users\Administrator\分页
> node ./bin/www

2402000
Port 3000 is already in use
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! app@0.0.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the app@0.0.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!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2018-08-16T03_20_58_752Z-debug.log
Program exited with status code of 1.undefined

应用没有正常关闭,每次都要杀进程再启动.请问是什么导致的?
log:

0 info it worked if it ends with ok
1 verbose cli [ 'D:\\Program Files\\node\\node.exe',
1 verbose cli   'D:\\Program Files\\node\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start' ]
2 info using npm@5.6.0
3 info using node@v8.11.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle app@0.0.0~prestart: app@0.0.0
6 info lifecycle app@0.0.0~start: app@0.0.0
7 verbose lifecycle app@0.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle app@0.0.0~start: PATH: D:\Program Files\node\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Administrator\Desktop\ubuntu\app\node_modules\.bin;D:\Program Files\node\;D:\Program Files\brackets\command;D:\Program Files\node.js;C:\Users\Administrator\AppData\Roaming\npm
9 verbose lifecycle app@0.0.0~start: CWD: C:\Users\Administrator\Desktop\ubuntu\app
10 silly lifecycle app@0.0.0~start: Args: [ '/d /s /c', 'node ./bin/www' ]
11 silly lifecycle app@0.0.0~start: Returned: code: 1  signal: null
12 info lifecycle app@0.0.0~start: Failed to exec start script
13 verbose stack Error: app@0.0.0 start: `node ./bin/www`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (D:\Program Files\node\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (D:\Program Files\node\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid app@0.0.0
15 verbose cwd C:\Users\Administrator\Desktop\ubuntu\app
16 verbose Windows_NT 6.2.9200
17 verbose argv "D:\\Program Files\\node\\node.exe" "D:\\Program Files\\node\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v8.11.3
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error app@0.0.0 start: `node ./bin/www`
22 error Exit status 1
23 error Failed at the app@0.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文