Search code examples
node.jssails.jsforever

Sails server not started


I'm trying to run my app with the following command :

forever start /var/www/app.js --prod

But I have this error :

To run an app using `node app.js`, you usually need to have a version of `sails` installed in the same directory as your app.
To do that, run `npm install sails`

Alternatively, if you have sails installed globally (i.e. you did `npm install -g sails`), you can use `sails lift`.
When you run `sails lift`, your app will still use a local `./node_modules/sails` dependency if it exists,
but if it doesn't, the app will run with the global sails instead!

Sails is already installed on the same directory. Forever is installed globally.

I also test

node app.js --prod

But same error so it's not because of forever.

I'm under node V4.1.1 and npm v3.3.4. sails lift work great.


Solution

  • Finally got it working! Some of sails dependency doesn't correctly installed, I have removed all the node_modules folder of my project and npm install again and now it's working.

    The error message is not correct.