12

I had node version v6.11.1 installed but it was giving error in some package, so i installed v10.15.3 with nvm and set it as default.

#If I run my app directly using node, it uses correct node version v10.15.3 and works
node server.js

#If I run using pm2 it uses old node version v6.11.1 and causes error.
pm2 start server.js

I tried passing --interpreter like

pm2 start server.js --interpreter=~/.nvm/versions/node/v10.15.3/bin/node
#but even this uses v6.11.1

I verify the node version by printing process.version inside my app.

Andro
  • 381
  • 1
  • 4
  • 9

1 Answers1

10

For later fellow googlers:

pm2 update

did help me in a similar case.

Found here: https://github.com/keymetrics/pm2-plus-tech-questions/issues/88

Tobias Gepp
  • 141
  • 1
  • 4