fython / PackageTracker-NodeServer

Package Tracker (Node.js) Server for third-party api support and fcm push
MIT License
41 stars 6 forks source link

npm ERR。请求指点 #6

Open yEs1do opened 7 years ago

yEs1do commented 7 years ago

[root@vultr PackageTracker-NodeServer]# npm start

packagetracker-push@0.1.0 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! packagetracker-push@0.1.0 start: node ./server.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the packagetracker-push@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! /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 packagetracker-push@0.1.0 start: node ./server.js 22 error Exit status 1 23 error Failed at the packagetracker-push@0.1.0 start script. 23 error This is probably not a problem with npm. There is likely additional logging output above.

自行解决 “ELIFECYCLE” 无果,求助。

fython commented 6 years ago

我的日志输出代码有问题,有空我就我更新一下。

kkren commented 6 years ago

在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 npm@5.6.0 3 info using node@v9.3.0 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle packagetracker-push@0.1.0~prestart: packagetracker-push@0.1.0 6 info lifecycle packagetracker-push@0.1.0~start: packagetracker-push@0.1.0 7 verbose lifecycle packagetracker-push@0.1.0~start: unsafe-perm in lifecycle true 8 verbose lifecycle packagetracker-push@0.1.0~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 packagetracker-push@0.1.0~start: CWD: /root/PackageTracker-NodeServer 10 silly lifecycle packagetracker-push@0.1.0~start: Args: [ '-c', 'node ./server.js' ] 11 silly lifecycle packagetracker-push@0.1.0~start: Returned: code: 137 signal: null 12 info lifecycle packagetracker-push@0.1.0~start: Failed to exec start script 13 verbose stack Error: packagetracker-push@0.1.0 start: node ./server.js 13 verbose stack Exit status 137 13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16) 13 verbose stack at EventEmitter.emit (events.js:159:13) 13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:159:13) 13 verbose stack at maybeClose (internal/child_process.js:943:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5) 14 verbose pkgid packagetracker-push@0.1.0 15 verbose cwd /root/PackageTracker-NodeServer 16 verbose Linux 4.9.0-5-amd64 17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start" 18 verbose node v9.3.0 19 verbose npm v5.6.0 20 error code ELIFECYCLE 21 error errno 137 22 error packagetracker-push@0.1.0 start: node ./server.js 22 error Exit status 137 23 error Failed at the packagetracker-push@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 [ 137, true ]