I have not found a way of getting both packages running together. I tried to do @toxa's technique, but when my node.js app threw an exception nodemon would not automatically restart it, instead outputting an error message to the forever log:
nodemon] app crashed - waiting for file changes before starting...
However, forever has a -w
option and the following command is effectively the same as if I'm running nodemon and forever together:
forever start -w my-app.js
The downside of forever -w
versus nodemon
: forever
does not have a --delay option, so my server gets restarted once for each file that is changed.
Cannot start forever. script /current_working_directory/nodemon does not exist.
Is there a way to fix this? I've installed nodemon both locally and globally via npm. – Vibrate