xDinomode
By:
xDinomode

pm2 not starting my NodeJS web app

June 19, 2015 3.4k views
Node.js

Hello this is my first time working with a VPS. I've managed to follow the instructions from this tutorial https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-14-04 but once I reached the "Manage Application with PM2" everything stopped working. Basically my web app works when I run "node index.js" (index.js being where my express app starts) but when I try "pm2 start index.js" it says it's started but I can't reach it from my browser. It says it's online http://i.imgur.com/U6lgxk0.png but it's not. Help please.

4 comments
1 Answer

For anyone having this issue, I solved it by appending some required node parameters.

Mine looked like this: pm2 start app.js --node-args="--harmony-destructuring --harmony_rest_parameters"

You may need to pass in some required arguments. Check package.json for a start script.

http://pm2.keymetrics.io/docs/usage/quick-start/#42-starts

Have another answer? Share your knowledge.