Rich
Rich

Reputation: 357

Yeoman angular generator install runs but generator doesn't appear in generator list

I've tried to install the yeoman angular generator with the following:

npm install -g generator-angular

It all looks like it's installed properly...

...
npm http GET https://registry.npmjs.org/string_decoder
npm http 304 https://registry.npmjs.org/string_decoder
npm http GET https://registry.npmjs.org/event-emitter
npm http GET https://registry.npmjs.org/next-tick
npm http 304 https://registry.npmjs.org/event-emitter
npm http 304 https://registry.npmjs.org/next-tick
[email protected] /Users/rich/.node/lib/node_modules/generator-angular
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

Full log here: https://dl.dropboxusercontent.com/s/hs5dgy1i6f90vu4/angular-generator-log.txt

But every time I do: yo angular I get: You don't seem to have a generator with the name angular installed.

yo doctor says everything is ok and I have angular installed globally with npm.

yo --help shows:

Please choose a generator below.


Mocha
  mocha:app

Webapp
  webapp:app

I'm a bit baffled as there aren't any errors with installation...?

Upvotes: 16

Views: 8268

Answers (3)

wojakJS
wojakJS

Reputation: 1

I used this

npm remove -g yo generator-* yeoman-generator 
npm install -g yo generator-angular

and now everything works very well

Upvotes: 0

Ricardo Rivas
Ricardo Rivas

Reputation: 620

I've seen this problem a bunch of times, there are some problems because of node path. What you can do to fix this is very simple. You just need to tell node what is going to be the folder for global packages and this folder needs to have the same permissions as the user.

return the node path

npm config get prefix

create a node folder that you can destroy whenever you want

mkdir -p ~/.node

tell node to use this folder

npm config set prefix ~/.node

then try again npm install -g yo

Upvotes: -4

Snick
Snick

Reputation: 1042

Strangely enough I fixed this very same problem by replacing

npm install -g generator-angular

with

npm install -G generator-angular

Note the capital G in the second command

Upvotes: 34

Related Questions