尝试在Windows上使用npm安装yo

问题描述 投票:4回答:2

我在Windows上,我正在尝试按照http://yeoman.io/learning/index.html上的说明操作。到目前为止,我已经成功安装了grunt-cli和bower但是当我尝试使用以下命令安装你时...

npm install -g yo

...命令提示符返回:

> [email protected] postinstall C:\Users\Aaron\AppData\Roaming\npm\node_modules\yo\node_modules\cross-spawn\node_modules\spawn-sync
> node postinstall

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "yo"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
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! [email protected] postinstall: `node postinstall`
npm ERR! spawn ;C:\Windows\system32\cmd.exe ENOENT
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node postinstall'.
npm ERR! 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 their info via:
npm ERR!     npm owner ls spawn-sync
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Aaron\AppData\Roaming\npm\node_modules\npm-debug.log

有谁知道这到底意味着什么以及如何解决它?

node.js npm yeoman
2个回答
0
投票

你可以试试这个:https://github.com/npm/npm/issues/7781

我认为这有助于您解决问题。

并在cmd中获取node&npm。您可以在Windows环境变量中设置节点位置。然后重新启动cmd并再次尝试执行此操作。


0
投票

尝试使用功能npm包管理器重新安装设置,然后返回到您的npm安装。

© www.soinside.com 2019 - 2024. All rights reserved.