npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm a nd is now out of date with respect to npm 首先请原谅我的伸手党属性,我对nodejs一点都不会,只是用来安装一些工具。
搜索了很久,以下方法都试过了
1.升级nodejs和npm版本
2.换源
3.npm i install -g yeoman-doctor
4.清楚缓存改变全局安装目录等
错误信息如下
C:\Users\yy>npm install -g yo
'CALL "D:\nodejs\\node.exe" "D:\nodejs\\node_modules\npm\bin\npm-cli.js" prefix
-g' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm a
nd is now out of date with respect to npm
D:\nodejs\node_global\yo -> D:\nodejs\node_global\node_modules\yo\lib\cli.js
D:\nodejs\node_global\yo-complete -> D:\nodejs\node_global\node_modules\yo\lib\c
ompletion\index.js
> spawn-sync@1.0.15 postinstall D:\nodejs\node_global\node_modules\yo\node_modul
es\spawn-sync
> node postinstall
D:\nodejs\node_global
`-- (empty)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn-sync@1.0.15 (node_modules\
yo\node_modules\spawn-sync):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn-sync@1.0.15 postinstall: `
node postinstall`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status -4058
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\\nodejs\\node.exe" "D:\\nodejs\\node_modules\\npm\\bin\\npm-cl
i.js" "install" "-g" "yo"
npm ERR! node v6.9.4
npm ERR! npm v3.10.10
npm ERR! file C:\Windows\system32\cmd.exe
npm ERR! path C:\Windows\system32\cmd.exe
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn C:\Windows\system32\cmd.exe
npm ERR! spawn-sync@1.0.15 postinstall: `node postinstall`
npm ERR! spawn C:\Windows\system32\cmd.exe ENOENT
npm ERR!
npm ERR! Failed at the spawn-sync@1.0.15 postinstall script 'node postinstall'.
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 spawn-sync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node postinstall
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs spawn-sync
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls spawn-sync
npm ERR! There is likely additional logging output above.
D:\nodejs\node_global
`-- (empty)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn-sync@1.0.15 (node_modules\
yo\node_modules\spawn-sync):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn-sync@1.0.15 postinstall: `
node postinstall`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status -4058
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\\nodejs\\node.exe" "D:\\nodejs\\node_modules\\npm\\bin\\npm-cl
i.js" "install" "-g" "yo"
npm ERR! node v6.9.4
npm ERR! npm v3.10.10
npm ERR! Callback called more than once.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\yy\npm-debug.log
npm ERR! code 1
```****
希望能解决这个问题,谢谢。