Dhairya Verma
Dhairya Verma

Reputation: 731

Sails: Using NODE_ENV=production not working, while NODE_ENV=prod works fine

I have config/env/production.js with production config.

When I try to start the server using PM2, it does not work. The server does not start and the process times out.

NODE_ENV=production pm2 start app.js

On renaming config/env/production.js to config/env/prod.js and using

NODE_ENV=prod pm2 start app.js

It works fine

This seems to be related to permission issues. I also tried it using 'sudo' but it did not help.

Does anyone have any idea about this?

Upvotes: 2

Views: 78

Answers (1)

Taha Boulehmi
Taha Boulehmi

Reputation: 227

Try to start the server using:

pm2 start app.js -- --prod

Upvotes: 1

Related Questions