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

Viewed 46

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?

1 Answers

Try to start the server using:

pm2 start app.js -- --prod
Related