Forever: With two node versions installed, specify a node version to run with

forever, node.js

Solution

You can also use -c to specify the command:

forever start \
  -c /opt/node-0.8.22-1e7b3d5/bin/node \
  /var/www/app/server.js

-c defaults to `node`, so normally `forever` will just use the first `node` in the $PATH.

Problem

I need 2 versions of NodeJS to run two different applications. One version is available in the default path so I can run it by calling `node`. The other version is installed at `~/node-v10/bin/node`. When I do `forever start app.js`, it's started with the first version. I How do I start a forever script with the second node version? Forever doesn't appear to have a configuration to allow me to specify the node path. I've tried this, but it doesn't work. Forever still starts with the old version: ``` NODE_PATH=~/node-v10/bin/node forever start app.js ```

Original source