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 Server Management Service.

Let’s take a look at how our Support Team is ready to help customers when they are unable to use NPM install for Node.js application in Plesk

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

  1. First, enter the extension name in the search bar on the right side and select the extension as it appears in the list.
  2. Then, select Get it free to start the installation.

Unable to use NPM install for Node.js application in Plesk

How to enable or disable a Plesk extension

  1. First, change to the My Extensions tab and choose the extension name.
  2. Next, select More > Enable/Disable.

How to remove a Plesk extension

  1. Here, we will change to the My Extensions tab and choose the extension name.
  2. 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:

  1. First, change to the Update tab and choose Check Now to scan for any recent updates.
  2. 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.

  1. First, we have to connect to the server through SSH.
  2. 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? We are just a click away.]

Conclusion

In brief, our skilled Support Engineers at Bobcares demonstrated what to do when unable to use NPM install for Node.js application in Plesk.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED