Unable to use NPM install for Node.js application in Plesk | Resolved
Unable to use NPM install for Node.js application in Plesk and not sure what to do? Find out what our in-house experts suggest.
At Bobcares, we offer solutions for every query, big and small, as a part of our
Let’s take a look at how our
Why are we unable to use NPM install for Node.js application in Plesk
If you have been coming across the following error message while trying to deploy Node.js application in Domains > example.com > Node.js > NPM Install, you have come to the right place.
/usr/bin/env: ‘node’: No such file or directory
Our Support Engineers recommend updating the server to avoid this particular issue.
How to update Plesk extensions
In order to manage Plesk extensions, we have to log in to Plesk as an ‘admin’ user and select Extensions from the left pane. After that we can carry perform the following actions:
- Installing a Plesk extension
- Enabling or Disabling a Plesk extension
- Removing a Plesk extension
- Updating a Plesk extension
How to install a Plesk extension
- First, enter the extension name in the search bar on the right side and select the extension as it appears in the list.
- Then, select Get it free to start the installation.
How to enable or disable a Plesk extension
- First, change to the My Extensions tab and choose the extension name.
- Next, select More > Enable/Disable.
How to remove a Plesk extension
- Here, we will change to the My Extensions tab and choose the extension name.
- Then, select More > Remove.
How to update a Plesk extension
Although Plesk extensions are updated automatically, we can also do it manually with these steps:
- First, change to the Update tab and choose Check Now to scan for any recent updates.
- If any updates are available, select the corresponding checkboxes and click Update.
Workaround to use NPM install for Node.js application in Plesk
If upgrading the server does not resolve the issue, our Support Engineers have another workaround to get the job done.
- First, we have to connect to the server through SSH.
- Next, we will change the affected path in /opt/plesk/node/12/lib/node_modules/npm/bin/npm-cli.js as well as other files to the correct one. For instance, here is an example for NodeJS 12:
# find /opt/plesk/node/12 -type f -print0 | xargs -0 sed -i -e '1s,#!/usr/bin/env node,#!/opt/plesk/node/12/bin/node,g' -e '1s,^#!s*/usr/bin/python($|s),#!/usr/bin/python21,' -e '1s,^#!s*/usr/bin/envs+python($|s),#!/usr/bin/env python21,'
[Looking for a solution to another query?
In brief, our skilled