2014-01-10 6 views
9

migrieren mein System von Ubuntu 13.04 bis 13.10, ich habe neueste nodejs Paket von der Ubuntu Logitech (das ist der Name des automatischen Paketinstallationsprogramms, weiß nicht, ob es das ist gleich in Englisch ...).Installieren Sie yeoman mit den neuesten nodejs 1.10.15

versucht Yeoman mit dem Befehl zu installieren:

npm install -g yo 

gibt mir die folgende Fehlermeldung:

npm http 200 https://registry.npmjs.org/is/-/is-0.2.7.tgz 
/usr/local/bin/yo -> /usr/local/lib/node_modules/yo/cli.js 

> [email protected] postinstall /usr/local/lib/node_modules/yo 
> node ./scripts/doctor 

sh: 1: node: not found 
npm WARN This failure might be due to the use of legacy binary "node" 
npm WARN For further explanations, please read 
/usr/share/doc/nodejs/README.Debian 

npm ERR! [email protected] postinstall: `node ./scripts/doctor` 
npm ERR! `sh "-c" "node ./scripts/doctor"` failed with 127 
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script. 
npm ERR! This is most likely a problem with the yo package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  node ./scripts/doctor 
npm ERR! You can get their info via: 
npm ERR!  npm owner ls yo 
npm ERR! There is likely additional logging output above. 

npm ERR! System Linux 3.11.0-15-generic 
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo" 
npm ERR! cwd /var/www 
npm ERR! node -v v0.10.15 
npm ERR! npm -v 1.2.18 
npm ERR! code ELIFECYCLE 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /var/www/npm-debug.log 
npm ERR! not ok code 0 

bei /usr/share/doc/nodejs/README.Debian Suche:

The upstream name for the Node.js interpreter command is "node". 
In Debian the interpreter command has been changed to "nodejs". 

This was done to prevent a namespace collision: other commands use 
the same name in their upstreams, such as ax25-node from the "node" 
package. 

Scripts calling Node.js as a shell command must be changed to instead 
use the "nodejs" command. 

Also meine Schlussfolgerung ist, um mit Nodejs 1.10.15 zu arbeiten, sollte das Yeoman Skript seinen Aufruf zu "Knoten" ändern zu „NodeJS“

Wie ich weiß nicht, wie es zu ändern, würde ich gerne wissen: 1. ist ein weiterer Yeoman Skript dort mit NodeJS 1.10.15 2. zu arbeiten, wenn ich meine NodeJS Version herabzuzustufen , wird das Installationsskript funktionieren (wenn ja, wie kann ich eine Downgradeversion von nodejs installieren)

Vielen Dank für Ihre Ideen!

teilweise aufgelöste:

ln -sf /usr/bin/nodejs /usr/bin/node 

des Installationsskript machen funktioniert, aber nicht wissen, ob diese Lösung sauber ist ...

+0

möglich Duplikat [NodeJS vs Knoten auf Ubuntu 12.04] (http://stackoverflow.com/questions/18130164/nodejs- vs-node-on-ubuntu-12-04) –

+0

Mögliches Duplikat von [npm install -g yo Befehl gibt -> ERR! [email protected] postinstall: 'node scripts/doctor.js'] (http://stackoverflow.com/questions/20881075/npm-install-g-yo-command-gives-err-yo1-1-0-postinstall -node-scripts-doct/21667861 # 21667861) – Molomby

Antwort

1

Ich glaube, das zu einer neuen Ausgabe ähnlich genug ist, dass die Lösung, die ich‘ Da kann es nützlich sein. Genauer gesagt, npm install -g yo command gives -> ERR! [email protected] postinstall: 'node scripts/doctor.js'.

Klonen Sie im Grunde das Yeoman Repo und bearbeiten Sie die package.json, um den Nachinstallationsaufruf zu doctor.js zu entfernen. Kaum eine ideale Lösung, aber es funktionierte für mich .. siehe meine Antwort im anderen Thread für Details.

16

Um dieses Problem zu lösen, müssen Sie das Paket nodejs-legacy installieren.

sudo apt-get install nodejs-legacy 
+0

Das hat bei mir funktioniert, danke! –

+0

Arbeitete auch für mich! – robabby

0

Überprüfen Sie, ob Sie die richtige Sprache und Codierung erhalten haben. In meinem Setup, hatte ich zum ersten Mal nodejs-legacy zu installieren und hatte zusätzlich LC_ALL zu ändern:

export LC_ALL=en_US.utf8