2016-02-29 4 views
0

Я пытался установить йоман. Но я встретил следующие ошибки.сбой, пока «npm install -g yo»?

C:\Users\xxxxx>npm install -g yo 
npm WARN deprecated [email protected]: this package has been reintegrated into npm a 
nd is now out of date with respect to npm 
C:\Users\xxxxx\AppData\Roaming\npm\yo -> C:\Users\xxxxx\AppData\Roaming\npm\ 
node_modules\yo\lib\cli.js 

> [email protected] postinstall C:\Users\xxxxx\AppData\Roaming\npm\node_modules\yo 
> yodoctor 

'yodoctor' is not recognized as an internal or external command, 
operable program or batch file. 
npm ERR! Windows_NT 6.1.7601 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xxxxx\\AppData 
\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "yo" 
npm ERR! node v4.1.1 
npm ERR! npm v3.3.7 
npm ERR! code ELIFECYCLE 

npm ERR! [email protected] postinstall: `yodoctor` 
npm ERR! Exit status 1 
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!  C:\Users\xxxxx\npm-debug.log 

Затем я попытался установить npm install -g yeoman-doctor для обхода этой ошибки. После того, как yoman-doctor был установлен, yodoctor можно найти, как показано ниже.

C:\Users\xxxx>yodoctor 

Yeoman Doctor 
Running sanity checks on your system 

√ Global configuration file is valid 
√ NODE_PATH matches the npm root 
x Node.js version 

Your Node.js version is outdated. 
Upgrade to the latest version: https://nodejs.org 

√ No .bowerrc file in home directory 
√ No .yo-rc.json file in home directory 
√ npm version 

Found potential issues on your machine :(

Но, к сожалению, проблема все еще возникает, когда я перепробовал «npm install -g yo».

Не могли бы вы рассказать об обходном пути? Благодарю .

ответ

1

Ошибка показывает, что ваш npm устарел. Вам нужно сначала обновить npm.

Попробуйте npm -g update

или

npm -g install npm

+0

Я обновил его, но та же ошибка происходит –

+0

Какой путь вы обновляете 'npm'? Вы пытались выполнить npm -g install npm? –

+0

Я использовал 'npm -g update', и я даже обновил node.js до 4.3.1. Но это все еще не работает. Текущая версия npm - 3.3.7. –