2015-11-02 19 views
8

Unten ist der Fehler, den ich bekomme. Es scheint ein Problem nach der Installation mit yodoctor anzuzeigen. Leider ist yodoctor der Rat, der vom yeoman Team gegeben wird, um mit diesem Problem zu helfen. Ich habe andere node_module installiert (Bower, Grunt, Typoskript).yodoctor: Befehl nicht gefunden, wenn Sie yo vom Terminal installieren

sh: yodoctor: command not found 
npm ERR! Darwin 15.0.0 
npm ERR! argv "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/bin/npm" "install" "-g" "yo" 
npm ERR! node v5.0.0 
npm ERR! npm v3.3.9 
npm ERR! file sh 
npm ERR! code ELIFECYCLE 
npm ERR! errno ENOENT 
npm ERR! syscall spawn 

npm ERR! [email protected] postinstall: `yodoctor` 
npm ERR! spawn ENOENT 
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script 'yodoctor'. 
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!  yodoctor 
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! Please include the following file with any support request: 
npm ERR!  /Users/jesselawson/.node_modules_global/lib/node_modules/npm-debug.log 
+0

Sie Knoten installiert haben/npm wird gebraut oder nach welcher Methode? – alphapilgrim

Antwort

3

Dieser Fehler verursacht wird in der Regel, weil jemand sudo zu einem gewissen Punkt und verwirrte ihre npm Paket Verzeichnisberechtigungen auf. Als Faustregel gilt: Verwenden Sie niemals Sudo.

Also, wie können Sie es beheben? Hier ist ein paar Punkte zur Problembehandlung:

  1. Stellen Sie sicher, dass Sie npm auf die neueste Version aktualisieren (npm install -g npm). npm 2.x hatte einige Race Conditions, die versuchen würden, yodoctor vor der Installation auszuführen.
  2. Stellen Sie sicher, dass der globale npm-Modulordner chown/chmod to your user ist.
  3. Stellen Sie sicher npm module binaries is in your PATH.
  4. Wenn nichts funktioniert, dann können Sie die Installation erzwingen, indem Sie npm i -g yeoman-doctor && npm i -g yo ausführen - aber das ist wirklich eine letzte Lösung.
0

einfach den folgenden Befehl würde den Trick:

sudo npm install -g yo 

wenn nicht, wo yo ist, fügen Sie ihn auf den Pfad wie folgt:

export PATH="$PATH:<path where yo is installed>" 
+0

Ich wollte bekräftigen, dass Simon Boudrias 'Antwort meiner Meinung nach eher meine Situation ist, und scheint mir eine angemessenere Lösung zu sein. Dies geschah, nachdem ich mehrere sudo-required-Situationen erhalten hatte und schließlich mein npm-Präfix änderte: https://stackoverflow.com/a/25447784/1091943. Ähnlich wie das, was Baksosapi sagte, ein npm-Update, und -h yo install wieder funktioniert. https://github.com/yeoman/yo/issues/465#issuecomment-237986250 – Pysis