Forever: when using two versions of node, specify the version of node to run with

I need 2 versions of NodeJS to run two different applications. One version is available by default, so I can run it by calling node . Another version is installed on ~/node-v10/bin/node .

When I do forever start app.js , it started with the first version. I

How do I run a wever script with the second version of node? There is no configuration on Forever that allows me to specify the node path.

I tried this, but it does not work. Forever still starts with the old version:

 NODE_PATH=~/node-v10/bin/node forever start app.js 
+6
source share
1 answer

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 is node by default, so usually forever will only use the first node in $ PATH.

+3
source

Source: https://habr.com/ru/post/943675/


All Articles