nodemon: Starting inspector on 0.0.0.0:9229 failed: address already in use
nodemon -v: 1.18.8node -v: 9.4.0- Operating system/terminal environment: ubuntu 18.04
- Using Docker? What image: docker -> FROM node:slim
- Command you ran: ./node_modules/.bin/nodemon --inspect=0.0.0.0 --legacy-watch ./src ./src/index.js
Expected behaviour
inspector restart on file change
Actual behaviour
Starting inspector on 0.0.0.0:9229 failed: address already in use
Steps to reproduce
using a dockerfile like :
FROM node:slim
# Create app directory
WORKDIR /usr/app
# Install app dependencies
COPY package.json /usr/app/
RUN npm install
# Bundle app source
COPY . /usr/app
CMD [ "npm", "run", "watch" ]
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (4 by maintainers)
Sorry for upping this, but I’m having the exact same issue 😐
[edit]: Seems to be working fine with
--signal SIGINTbut it prevents the process from getting killed in development.It’s fine in my case because it’s running in docker, but that’s probably not something fine
As described in #1476 I’m still seeing this issue with
1.18.9.The issue is intermittent with the following start command:
./node_modules/.bin/nodemon --inspect=0.0.0.0:9229 ./index.jsJust add
--delay 300msinto the command solved my problem.https://github.com/remy/nodemon#delaying-restarting
I fixed my problem by changing the npm
devscript and the nodemonexeccommand, to move the time of setting NODE_OPTIONS later, from this:to this:
What must have been happening was that node and/or nodemon was taking over listening on the port, but ts-node was also trying to do the same thing. By setting the environment variable later, that is avoided.
I get this issue all the time. Not sure when exactly it started happening, but it didn’t use to happen.
node v11.11.0 via alpine-v11
Would be happy to retrieve any logs or additional info to help narrow this down.
Maybe my workaround can help you guys: https://stackoverflow.com/questions/43898947/docker-node-app-always-crashes-on-file-change-using-nodemon/55881699#55881699