I can start my app using nodemon, just by typing nodemon
but got below error when I do node app.js
My package.json is configured properly. It has
"scripts": {
"start": "node ./bin/www"
}
I can start my app using nodemon, just by typing nodemon
but got below error when I do node app.js
My package.json is configured properly. It has
"scripts": {
"start": "node ./bin/www"
}
EADDRINUSE
means that a port your node application attempted to bind to, has already been bound to by another process. Typically this suggests you haven't killed your last node process before starting the current one, or you haven't configured your application to use the correct port (e.g., a system port that can't be bound to, or a port below 1024 which requires administrative access to bind to).
there is something in use, try to restart your machine and try again. =D
The port is already in use, there might be another instance of your application already running. To see what processes are running background use netstat -tlpn
and to filter node only processes netstat -tlpn | grep node
.
tcp 0 0 127.0.0.1:8081 0.0.0.0:* LISTEN 22917/node
tcp 0 0 127.0.0.1:8666 0.0.0.0:* LISTEN 358/node
tcp 0 0 127.0.0.1:8667 0.0.0.0:* LISTEN 4416/node
As you see the port 8081 is already taken, try to kill it and start you server again kill 22917
.