Trying to install yo with npm on Windows

10k views Asked by At

I am on Windows and am trying to follow the instructions at http://yeoman.io/learning/index.html. So far I have successfully installed grunt-cli and bower but when I try to install yo using the following command...

npm install -g yo

...the command prompt returns this:

> [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

Does anyone have any idea what the hell this means and how I can fix it?

2

There are 2 answers

0
Md Nazmul Hossain On BEST ANSWER

You can try with this : https://github.com/npm/npm/issues/7781

I think this will helps you to solve your question.

And to get node & npm in cmd. You can set node location in windows environment variable. Then restart your cmd & try again to do this.

0
Manisha Vannam On

Try re-installing the setup with feature npm package manager and then get back to your npm install.