Question

I just installed forever globally (-g). Before that I used to run with

$ npm start

Now after installed forever, I tried to lunch the node app

$ NODE_ENV=development forever nodemon server.js

but I receive this error

warn:    --minUptime not set. Defaulting to: 1000ms
warn:    --spinSleepTime not set. Your script will exit if it does not stay up for at     least 1000ms
error:   Cannot start forever
error:   script /path/to/app/nodemon does not exist.

the same also with

$ NODE_ENV=development forever nodemon server.js

any idea?

Was it helpful?

Solution

The error you received in your output:

error: script /path/to/app/nodemon does not exist.

It appears that forever is looking for nodemon in the current working directory, and can't find it because it doesn't exist there. Try providing the absolute path when starting nodemon, which can be found with which nodemon.

forever start /usr/local/bin/nodemon server.js

Note that the start flag is what puts the application in daemon mode.

OTHER TIPS

Try this

NODE_ENV=development forever start -c nodemon server.js

The -c is for execute commands, forever send you that error because it's looking for a app called nodeamon, but your app is server.js

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top