Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yeoman can't recognize a generator that was installed globally

Tags:

npm

yeoman

I ran sudo npm install -g generator-flask and it was saved. I was able to confirm by running npm list-g.

I then run yo flask. Thinking that this was going to work, I instead get an error message:

Error flask

You don't seem to have a generator with the name flask installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 22 registered generators run yo with the `--help` option.

I do as it tells me by running yo --help and discover that the flask generator is not there.

I try this with sudo npm install -g generator-angular-flask and the problem is recreated with Angular Flask. I'm assuming this is going to happen for all the generators which is why I've titled it as Yeoman not recognizing new npm installs.

Does anyone know why this has happened?

like image 621
BenMorganIO Avatar asked Mar 01 '14 18:03

BenMorganIO


People also ask

What is the command yo?

Simply typing yo in a terminal will provide a list of options to manage everything related to the generators: run, update, install, help and other utilities. Yo also provide the following commands. yo --help Access the full help screen.

How yeoman works?

: very good, hard, and valuable work that someone does especially to support a cause, to help a team, etc. They've done yeoman's work in raising money for the organization.


2 Answers

A workaround, but does solve the problem:

npm link generator-angular-flask

(as does just installing the module locally)

like image 156
Geoff Chappell Avatar answered Oct 12 '22 23:10

Geoff Chappell


Usually it is a $NODE_PATH issue, but rather then guessing, run:

yo doctor

and follow the instructions!

like image 31
Stefano Avatar answered Oct 13 '22 01:10

Stefano