Open andrewgbliss opened 7 years ago
Same here, I'm starting it with
nodemon --inspect=0.0.0.0:9229 /app/server.js
inside a container based on
FROM node:8.1.0
with a shared volume on sources. Whenever I save a file on the sources volume, nodemon restarts but crashes with
[nodemon] restarting due to changes...
nodemon bus emit: restart +13s
nodemon bus.emit(exit) via SIGUSR2 +14ms
nodemon bus emit: exit +0ms
[nodemon] starting `node --inspect=0.0.0.0:9229 /app/server.js`
nodemon spawning node --inspect=0.0.0.0:9229 /app/server.js +1ms
nodemon bus emit: start +7ms
nodemon bus new listener: exit (1) +1ms
nodemon start watch on: *.* +0ms
nodemon:watch early exit on watch, still watching (1) +1ms
Starting inspector on 0.0.0.0:9229 failed: address already in use
[nodemon] app crashed - waiting for file changes before starting...
Re-saving the same file, again restarts but works ok this time. I'm NOT using gulp-nodemon...just accidentally got here when searching for the issue. Seems to be an issue with nodemon itself.
Yeah same problem, using sails here + nodemon. Doing the following:
nodemon --inspect app.js
produces
error: Gulp :: Starting inspector on 127.0.0.1:9229 failed: address already in use
As the error shows up before any tasks are even attempted, I think this must be a deeper issue, potentiallu with gulp itself.
Just kill inspector and start inspector again
here is our team's solution in our package.json
The same in gulp task. You have to kill it first..
npm install --save-dev kill-port
in your package.json file. Kill it first before you run debug inspector on the same port.
"inspect": "kill-port --port 9229 && node --inspect=0.0.0.0:9229 build/startup.js",
"start_watch_inspect": "nodemon --delay 80ms --watch build/ build/startup.js --exec 'npm run inspect'",
please solve this
Please try not to use nodemon to enable debug mode. Try to use node --inspect=...
now generate this error
for put node --inspect=... at the place of nodemon --debug
Try this approach may be it helps.
Actually it's getting started in background so you need to search for process which you have tried to run with command like nodemon --inspect app.js , so check if node server is running or not.
ps ax | grep node
then killall -9 node and then try this command and it will work.
@yujiahaol68
kill-port: command not found
@wzup Please install kill-port as dev npm package first and then you can use it in your package.json script
No solution for this? It's really annoying as you don't even get output anymore when it fails..
This seems to be an irritating bug with no clear solution yet
Here is my nodemon gulpfile. I am running the process in a docker container.
Every time I save a file nodemon restarts as it normally would. But it also crashes with this error message:
Starting inspector on 0.0.0.0:9229 failed: address already in use app crashed - waiting for file changes before starting...
If I then save the file again it restarts it just fine. Is there a way to wait for the 9229 port to release before it starts again? It's really annoying to save a file twice just to get it to work.
If I change it to --debug it works, but that is deprecated. They want everyone to use --inspect.