PackageTracker-NodeServer
PackageTracker-NodeServer copied to clipboard
npm ERR。请求指点
[root@vultr PackageTracker-NodeServer]# npm start
[email protected] start /root/PackageTracker-NodeServer node ./server.js
Connecting to mongodb://127.0.0.1:27017/ptpush... (node:24992) DeprecationWarning: Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html Connected to database Http Server running at http://:::3000 events.js:182 throw er; // Unhandled 'error' event ^
TypeError: Reduce of empty array with no initial value at Array.reduce (
) at /root/PackageTracker-NodeServer/tasks.js:52:57 at model.Query. (/root/PackageTracker-NodeServer/node_modules/mongoose/lib/model.js:3822:16) at /root/PackageTracker-NodeServer/node_modules/kareem/index.js:273:21 at /root/PackageTracker-NodeServer/node_modules/kareem/index.js:131:16 at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] start: node ./server.jsnpm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] 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! /root/.npm/_logs/2017-09-14T14_00_00_086Z-debug.log
打开日志文件 2017-09-14T14_00_00_086Z-debug.log,部分信息如下:
18 verbose node v8.4.0 19 verbose npm v5.4.1 20 error code ELIFECYCLE 21 error errno 1 22 error [email protected] start:
node ./server.js22 error Exit status 1 23 error Failed at the [email protected] start script. 23 error This is probably not a problem with npm. There is likely additional logging output above.
自行解决 “ELIFECYCLE” 无果,求助。
我的日志输出代码有问题,有空我就我更新一下。
在Debian9复现
$ npm -v
5.6.0
$ node -v
v9.3.0
log:0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/root/PackageTracker-NodeServer/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle [email protected]~start: CWD: /root/PackageTracker-NodeServer
10 silly lifecycle [email protected]~start: Args: [ '-c', 'node ./server.js' ]
11 silly lifecycle [email protected]~start: Returned: code: 137 signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: node ./server.js
13 verbose stack Exit status 137
13 verbose stack at EventEmitter.node ./server.js
22 error Exit status 137
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 137, true ]