Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

nodejs + nodemon + forever give me an error

nodejs + nodemon + forever give me an error

Problem

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?

Problem courtesy of: Sasha Grey

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.

Solution courtesy of: hexacyanide

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

nodejs + nodemon + forever give me an error

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×