• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Problem with update npm for nodejs extension

Azurel

Silver Pleskian
Hello, I call update npm for nodejs extension (02 - How to install npm & manage npm versions | npm Documentation)
# /opt/plesk/node/8/bin/npm install npm@latest -g

After this I get now for
# /opt/plesk/node/8/bin/npm -v
this line
/usr/bin/env: node: No such file or directory

I have remove and install nodejs extension in plesk gui again, but that not fix it. How I can repair it?

Version 6+7 is working fine:
# /opt/plesk/node/7/bin/npm -v
4.0.5
 
Last edited:
You can fix it with

# export PATH=/opt/plesk/node/8/bin
 
I must re-activate this topic. :(

After a week (I not changed anything on server) the node.js client crashed, so I must restart it, but again... node 8 is not accessable

# /opt/plesk/node/8/bin/npm -v
/usr/bin/env: node: No such file or directory

After again
# export PATH=/opt/plesk/node/8/bin

# /opt/plesk/node/8/bin/npm -v
5.7.1

Now its working again. Must I now every few days do export?
 
Thanks! You mean that file located under /root/.bash_profile? I never work with export command before, so after take a look I think your command should look like this?:

# export PATH=$PATH:/opt/plesk/node/8/bin/

I think your example above overwrite all exists path? Because with your command "sh" not working anymore too

#sh myscript.sh start
-bash: sh: command not found

# export PATH=$PATH:/usr/bin/

And its working now again too. I have edit /root/.bash_profile like this on the bottom

PATH=$PATH:$HOME/bin
PATH=$PATH:/opt/plesk/node/8/bin
PATH=$PATH:/usr/bin/
export PATH

Can you me explain why my update NPM in start post remove the path and why re-install the NodeJS package not fix this issue? Thank you very much :)
 
Back
Top