• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

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 :)
 
It is not clear how an update of NPM removes the path to the latest node tools install. To solve this for all users I prefer to sym-link in /usr/bin to the npm executable.

With root user privileges use:

Code:
cd /usr/bin/
ln -s /opt/plesk/node/21/bin/npm npm

The node version 21 is the latest version installed in my case on AlmaLinux 9.5 which is now the derivative of Centos.

Plesk may overwrite or re-establish it's own PATH strategy so this link could be removed or linked to the latest node install.
 
Back
Top