2017-09-21 8 views
0

Ich habe eine API erstellt, die hummus.js Module verwenden. Localy getestet -> Funktioniert gut.Plesk installieren npm Pakete Fehler

Jetzt habe ich meine API hochgeladen und versuchen, npm install ausführen, um alle Abhängigkeiten zu installieren. Aber ich habe diesen Fehler:

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 

Die Fehler kommen aus dem hummus-js Paket. Also ich möchte versuchen, node-gyp (npm install -g node-gyp) zu installieren. Aber ich weiß nicht wie? In Plesk kann ich kein einziges Modul installieren. Wenn ich es mit ssh versuchen bekam i:

command NPM not found

Ich bin ein Server-Admin-Noob so, denn ich bin glücklich, jede Hilfe!

Grüße

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

+0

Mit 'meine API hochgeladen' meinen Sie versucht, es auf einem (Wolke ich nehme an) Server oder? –

+0

Ich habe einen Root-Server mit Plesk installiert – Ckappo

Antwort

0

Wenn ich richtig angenommen, es läuft darauf hinaus, Sie nicht auf Ihre anderen Rechner installiert Knoten aufweist. SSH in die Maschine, dann, für Debian und Ubuntu-basierten OS laufen

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

(unter der Annahme, wieder, dass Sie Knoten 8.x wollte), dann laufen

sudo apt-get install -y build-essential 

und für CentOS und andere 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 

versuchen dann nochmal was Sie getan haben.

+0

Ich habe Knoten Js installiert (Ich habe Plesk zu installieren und starten Sie meine API. Ein Test-API funktioniert gut (nur Knoten testen)) Aber mit SSH habe ich Befehl nicht gefunden – Ckappo

+0

Kannst du ssh Wenn Sie "ls -l/opt/plesk/node" aufrufen und darin laufen, sollten Sie einen Ordner namens "7" darin haben. Wenn Sie dies tun, führen Sie aus: "echo" export PATH =/opt/plesk/Knoten/7/bin: $ PATH '>> ~ /. Bashrc " Es ist höchstwahrscheinlich eine lokal installierte Node, daher können Sie nicht darauf zugreifen global. Dies sollte das Problem theoretisch beheben. –