简体   繁体   中英

yo meanjs doesn't work :: yeoman doesn't see generator

When I run

yo meanjs

I get the following error.

Error meanjs 

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

However when I run...

npm search yeoman-generator

I get this...

generator-meanis                         A Meanis Generator for Yeoman                             
generator-meanjs                         MEAN.JS Official Yeoman Generator                         
generator-meanjs-table                   MEAN.JS Table Yeoman Generator 

So I have meanjs generator installed, but it doesn't work. How do I fix this?

The usual debugging step anytime you can't find a generator is to run:

yo doctor

This will look through your computer and make sure everything is configured correctly.

The only case it doesn't detect correctly is when sometime people have multiple version of npm installed and that messes up the node ecosystem.

To recap :

  1. Run yo doctor
  2. If 1. doesn't work, then make sure you have a single npm installed on your machine.

If this doesn't work, then please open an issue on yeoman/yo so we can add more checks to the yo doctor command.

Per the docs , you need to install both yo and the generator:

$ npm install -g yo
$ npm install -g generator-meanjs

Then you can do:

$ yo meanjs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM