I have a problem with Yeoman generators. They install just fine if I run "npm install [generator-name] -g". However when I try to run "yo [generator-name] yeoman can't seem to find the generator. Neither is it listed among my other generators if I just run "yo". I've tried a bunch of generators and the result is always the same.
After a bit of bit of investigation I found that the downloaded generator is placed in
/usr/local/lib/node_modules/
But my other generators are placed in
/usr/local/lib/share/npm/lib/node_modules/
Here is an image of how it looks on my machine http://i.imgur.com/DxWTYHb.png, I'm running OSX in case that matters. Looks like something is wrong to me - but I cannot figure it out.
Not sure if this helps, but brew doctor and $NODE_PATH return nothing while $PATH returns:
-bash:
/usr/local/share/npm/bin:
/Users/marcus/.rvm/gems/ruby-2.0.0-p247/bin:
/Users/marcus/.rvm/gems/ruby-2.0.0-p247@global/bin:
/Users/marcus/.rvm/rubies/ruby-2.0.0-p247/bin:
/Users/marcus/.rvm/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/usr/local/bin:
/usr/local/git/bin: No such file or directory
UPDATE
I tried what Eddie Monge Jr suggested and now my angular generator works fine. However when I installed another generator (chrome-extension) yeoman insists that it's not installed/found.
When I run ls $(npm config get prefix)/lib/node_modules I get this:
bower generator-mocha
generator-angular grunt-cli
generator-chrome-extension npm
generator-karma yo
And npm list -g returns this (I cut out a lot of generic stuff)
/usr/local/lib
├─┬ [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
├─┬ [email protected]
├─┬ [email protected]
└─┬ [email protected]
The strange part for me is if I run yo --help I get a strange list of generators
[?] What would you like to do?
[ ] Run the Angular generator
[ ] Run the Foundation generator
[ ] Run the H5bp generator
[X] Run the Mocha generator
[ ] Run the Webapp generator
[ ] Run the Karma generator
[ ] Update your generators
[ ] Install a generator
[ ] Find some help
[ ] Get me out of here!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…