我如何克服 PM2 中已使用的 EADDRESS
正在 aws EC2 实例上运行 Node JS 服务器,
当我执行 Node Server.js 工作时,我
但是当我使用 pm2 启动服务器时,我收到代码:“EADDRINUSE”,安装 pm2 后甚至无法使用 Node Server.js 它还说 EADDRINUSE,所以要重新运行它,我必须卸载 pm2 并停止运行端口 3000 的节点进程,但是一旦我安装 pm2,端口 3000 就会变得不可用,
root 47971 0.7 2.7 647924 55712 ? Ssl 11:20 0:00 node /home/ubuntu/kanaswap-name-service/server.js
上述进程会自动运行 我什至无法杀死该进程
即使在终止进程后它也会自动运行,
I am running a node js server on aws EC2 instance
when i do node server.js its working but when i start the server using pm2 i am getting code: 'EADDRINUSE',
after installing pm2 can't even use node server.js it also says EADDRINUSE, so to rerun it i have to uninstall the pm2 and stop the node process that runs port 3000, but as soon as i install pm2 the port 3000 is becoming unavailable
root 47971 0.7 2.7 647924 55712 ? Ssl 11:20 0:00 node /home/ubuntu/kanaswap-name-service/server.js
the above process runs automatically when i install pm2 , i cant even kill that process
process that runs on port 3000
even after killing the process it runs automatically,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发生这种情况是因为每次启动 pm2 时它都会说该端口上的服务已经在运行,请尝试更改端口号,或者如果您使用的是 linux,则可以终止该进程,
这里是终止 linux 中进程的命令
这是为了获取 PID
,之后你可能会发现
运行此命令后的结果
this happens because everytime you start pm2 it says that a service on that port alredy running try changing the port no or you can kill the process if you are using linux
here is the command for kill the process in linux
this is for getting PID
after that you may find that result
after that run this