egg项目npm start启动报错
当使用npm start命令时报如下错误:
[egg-scripts] Save log file to /root/logs
[egg-scripts] Wait Start: 1...
[egg-scripts] Wait Start: 2...
[egg-scripts] Wait Start: 3...
[egg-scripts] Wait Start: 4...
[egg-scripts] Wait Start: 5...
[egg-scripts] tail -n 100 /root/logs/master-stderr.log
[egg-scripts] Got error when startup:
[egg-scripts] 2019-03-24 11:43:38,574 ERROR 6203 [app_worker] server got error: bind EADDRINUSE null:7001, code: EADDRINUSE
[egg-scripts] 2019-03-24 11:43:38,596 ERROR 6182 nodejs.AppWorkerDiedError: [master] app_worker#1:6203 died (code: 0, signal: null, suicide: false, state: dead), current workers: []
[egg-scripts] at Master.onAppExit (/home/www/nodejs-lo/node_modules/egg-cluster/lib/master.js:398:21)
[egg-scripts] at emitOne (events.js:116:13)
[egg-scripts] at Master.emit (events.js:211:7)
[egg-scripts] at Messenger.sendToMaster (/home/www/nodejs-lo/node_modules/egg-cluster/lib/utils/messenger.js:137:17)
[egg-scripts] at Messenger.send (/home/www/nodejs-lo/node_modules/egg-cluster/lib/utils/messenger.js:102:12)
[egg-scripts] at EventEmitter.cluster.on (/home/www/nodejs-lo/node_modules/egg-cluster/lib/master.js:267:22)
[egg-scripts] at emitThree (events.js:141:20)
[egg-scripts] at EventEmitter.emit (events.js:217:7)
[egg-scripts] at ChildProcess.worker.process.once (internal/cluster/master.js:185:13)
[egg-scripts] at Object.onceWrapper (events.js:317:30)
[egg-scripts] name: "AppWorkerDiedError"
[egg-scripts] pid: 6182
[egg-scripts] hostname: VM_129_145_centos
[egg-scripts]
[egg-scripts] 2019-03-24 11:43:38,596 ERROR 6182 [master] app_worker#1:6203 start fail, exiting with code:1
[egg-scripts] 2019-03-24 11:43:38,597 ERROR 6182 [master] exit with code:1
[egg-scripts] 2019-03-24 11:43:38,602 ERROR 6188 [agent_worker] receive disconnect event on child_process fork mode, exiting with code:110
[egg-scripts] 2019-03-24 11:43:38,605 ERROR 6188 [agent_worker] exit with code:110
[egg-scripts]
[egg-scripts] Start got error, see /root/logs/master-stderr.log
[egg-scripts] Or use --ignore-stderr to ignore stderr at startup.
本以为是端口被占用问题
但是使用npm stop停止时提示:
[egg-scripts] stopping egg application with --title=egg-server-nodejs-lo
[egg-scripts] can't detect any running egg process
[egg-scripts] stopped
通过ps查看node进程
[root@VM_129_145_centos nodejs-lo]# ps -ef|grep node
root 6874 4763 0 2020 pts/0 00:00:00 grep --color=auto node
不太明白上面啥意思,但是使用kill命令也没有用
莫名的问题出现,只是因为在项目里加了定时任务,其他代码没做什么改变
想请教下大家这个问题该如何解决?
非常感激!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你把文件全部删掉,然后再重新上传文件,如果
npm start
又出现报错,可以先试试npm stop
,可能是端口占用,我就是这么解决的