I have installed PM2 to keep my node application running. (https://github.com/Unitech/pm2)
It works great, however...
Since installing and running my app with it
pm2 start app.js pm2 stop app
I am no longer able to run my app using
node app.js
Instead I get the following error:
domain.js:66
throw er;
^
Error: listen EADDRINUSE
at errnoException (net.js:770:11)
at Server._listen2 (net.js:910:14)
at listen (net.js:932:10)
at Server.listen (net.js:998:5)
at Function.app.listen (/home/ssp/node_modules/express/lib/application.js:535:24)
at Object.<anonymous> (/home/ssp/app.dev.js:22:5)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
This error usually happens when you try to run the same thing twice.
However app.js is not running. I have stopped it in PM2. And when I type
ps aux | grep node
To check if it is still there, it is not.
Uninstalling PM2 does not seem to fix this. Any ideas what is going on?
pm2 listsay? is it still keeping the port open "for convenience"?pscommand you mention; either grep forapp(instead ofnode) or usepm2 listinstead, as Mike suggests.