forever with nodemon (command line)

997 Views Asked by At

I'm trying to use nodemon with forever.

I have no problems with nodemon alone:

nodemon --exitcrash node/index.js -- "user/verbs/config"

However, in following the instructions in the nodemon FAQ, and putting quotes around "nodemon --exitcrash" as per the comment at https://stackoverflow.com/a/20306929/271577 (to avoid forever thinking the argument "user/verbs/config" is the file) to produce:

forever start --minUptime 1000 --spinSleepTime 1000 --killSignal=SIGTERM -c "nodemon --exitcrash" node/index.js -- "user/verbs/config"

...I get the message

info: Forever processing file: node/index.js

and no continuation of the script. Running forever list shows "No forever processes running".

(Note: I eventually want this working with forever-monitor, but I figure the above will need to work first.)

Is there something I'm missing?

1

There are 1 best solutions below

0
Permanently On
forever -c "nodemon --exitcrash" app.js

this makes sure nodemon actually exits (rather than giving you the "app crashed" message) and then forever picks it up again.

In forever --help this -c specifies a command to run otherwise it defaults node. Without -c results in the error that is mention in the comments to this answer.

Source