节点服务器关闭了ELIFECYCLE

时间:2019-04-19 10:02:33

标签: node.js express server

我有一台Node.js网络服务器,在一天中的大部分时间里都运行良好,但是在随机点,我开始出现错误。由于服务器启动时出现ELIFCYCLE,服务器关闭:22 error website@1.0.0 start: 'npx pm2 start server.js --watch'

我还是Node的新手,所以我真的不知道问题是什么。而且我不知道如何重现该问题。

完整的错误日志如下:

0 info it worked if it ends with ok
1 verbose cli [ '~/bin/node',
1 verbose cli   '~/bin/npm',
1 verbose cli   'start',
1 verbose cli   '--production' ]
2 info using npm@6.9.0
3 info using node@v11.14.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle website@1.0.0~prestart: website@1.0.0
6 info lifecycle website@1.0.0~start: website@1.0.0
7 verbose lifecycle website@1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle website@1.0.0~start: PATH: ~/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:~/public_node/node_modules/.bin:~/perl5/bin:/usr/local/jdk/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/cpanel/composer/bin:/usr/local/bin:/usr/X11R6/bin:~/.local/bin:~/bin
9 verbose lifecycle website@1.0.0~start: CWD: ~/public_node
10 silly lifecycle website@1.0.0~start: Args: [ '-c', 'npx pm2 start server.js --watch' ]
11 silly lifecycle website@1.0.0~start: Returned: code: 1  signal: null
12 info lifecycle website@1.0.0~start: Failed to exec start script
13 verbose stack Error: website@1.0.0 start: `npx pm2 start server.js --watch`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (~/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:193:13)
13 verbose stack     at ChildProcess.<anonymous> (~/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:193:13)
13 verbose stack     at maybeClose (internal/child_process.js:999:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:266:5)
14 verbose pkgid website@1.0.0
15 verbose cwd ~/public_node
16 verbose Linux 3.10.0-714.10.2.lve1.5.17.1.el7.x86_64
17 verbose argv "~/bin/node" "~/bin/npm" "start" "--production"
18 verbose node v11.14.0
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error website@1.0.0 start: `npx pm2 start server.js --watch`
22 error Exit status 1
23 error Failed at the website@1.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 ]

我想如果系统运行正常,应该以1退出,网站保持在线状态。

0 个答案:

没有答案