nodemon: nodemon cannot run in background with nohup?

I use nohup nodemon server.js &. It seems nodemon is killed soon.

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 34 (4 by maintainers)

Commits related to this issue

Most upvoted comments

this may be help: nohup nodemon app.js </dev/null &

details: https://github.com/remy/nodemon/issues/98

Another possible solution:

nohup nodemon -I app.js

The -I switch prevents nodemon from attempting to use STDIN, which isn’t allowed under nohup as there’s no input stream.

@leoliaolei you can use nodemon with tmux

nohup nodemon app.js </dev/null & works for me! thanks!

I had same issue. Here is my work around Created a shell script exec.sh

cd source
nodemon app.js

Then execute the script with nohup

nohup exec.sh

i can put it to background, but after close ssh connection, nodemon stopped, because after connecet to ssh again i dont have any package on background

Last login: Mon Jul 25 10:01:35 2016 from 46.224.238.119 hello@ubuntu:~$ fg -bash: fg: current: no such job

I has try nohup nodemon </dev/null & But not work, I got log

8 Jul 15:00:57 - [nodemon] v1.2.0 8 Jul 15:00:57 - [nodemon] to restart at any time, enter rs 8 Jul 15:00:57 - [nodemon] watching: _._ 8 Jul 15:00:57 - [nodemon] starting node ./bin/www events.js:85 throw er; // Unhandled ‘error’ event ^ Error: listen EADDRINUSE at exports._errnoException (util.js:742:11) at Server._listen2 (net.js:1126:14) at listen (net.js:1148:10) at Server.listen (net.js:1223:5) at Server.listen (/var/www/appota_inside/node_modules/livereload/lib/livereload.js:69:28) at Object.exports.createServer (/var/www/appota_inside/node_modules/livereload/lib/livereload.js:201:12) at Object.<anonymous> (/var/www/appota_inside/app.js:28:21) at Module._compile (module.js:449:26) at Object.Module._extensions…js (module.js:467:10) at Module.load (module.js:349:32) 8 Jul 15:00:58 - [nodemon] app crashed - waiting for file changes before starting…