Plesk install npm packages Error

2.3k Views Asked by At

I created an API that use hummus.js modules. Localy tested -> Works fine.

Now I uploaded my API and try to run npm install to install all dependencies. But I got this Error:

npm-Installation
Execution filemng has failed with exit code 1, stdout:
> [email protected] install /var/www/vhosts/XXX/XXX/node_modules/hummus
> node-pre-gyp install --fallback-to-build
, stderr: npm WARN lifecycle npm is using /opt/plesk/node/7/bin/node but there is no node binary in the current PATH. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
/usr/bin/env: 'node': No such file or directory
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
npm ERR! Linux 4.4.0-21-generic
npm ERR! argv "/opt/plesk/node/7/bin/node" "/opt/plesk/node/7/bin/npm" "install"
npm ERR! node v7.4.0
npm ERR! npm v4.0.5
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the hummus package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs hummus
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls hummus
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/vhosts/XXX/XXX/npm-debug.log

The Error come from the hummus-js package. So I want to try install node-gyp ( npm install -g node-gyp ). But I don't know how? In Plesk I canno't install a single module. When I try it with ssh i got:

command NPM not found

I'm a Server-Admin-Noob so I'm happy for every Help!

Greetings

EDIT: My Server = Ubuntu 16.04 LTS Server 64bit + Plesk Onyx Plesk NodeJS

1

There are 1 best solutions below

2
On

If I assumed correctly, it boils down to you not having Node installed on your other machine. SSH into the machine, then, for debian and ubuntu-based OS run

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

(assuming, again, that you wanted Node 8.x), then run

sudo apt-get install -y build-essential

and for CentOS and other enterprise Linux OS:

curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
sudo yum -y install nodejs
sudo yum install gcc-c++ make

Then try redoing what you did.