[[email protected] xxxx]# n
installed : v14.8.0 to /usr/local/bin/node
active : v10.21.0 at /bin/node
Installed node version 14.8.0 using n. Not sure how 10.21.0 was installed. Cannot delete or switch versions. I am using pm2 process manager and need the versions switched i.e dont want to run n run v14.8.0 server.js i would rather change the active version globally, so that running pm2 start would not need to specify a specific version. Please help.
First, you can explicitly select /usr/local/bin/node by creating a file like
Make sure to rename it to something ending with
.shThen to run it with pm2 you can dopm2 run yourfilename.shSecond, you can use a shebang line in server.js, so the first line must be
And you can run your script the way you were doing it before