How can I run pm2 on a certain node version?

Use pm2 and specify node version using –interpreter flag with node version absolute path:

sudo pm2 start app.js --interpreter=/home/ken/.nvm/v4.4.2/bin/node

or

sudo pm2 start app.js --interpreter=/home/ken/.nvm/v7.4.0/bin/node

etc..

If you change the node version wherever I mentioned --interpreter="***.." the app will run in exact node version.

Once you completed the above approach to verify use following command

sudo pm2 show 'app name'

Leave a Comment

tech