Search code examples
ecmascript-6yeomanyeoman-generator

Another one "You don’t seem to have a generator with the name"


I'm trying to make a simple Yeoman generator in ES6. I think I followed the documentation. After $npm linkin the current folder of my generator i go in another directory and try :

? 'Allo Emmanuel! What would you like to do? (Use arrow keys)
Run a generator
❯ Starterpack
──────────────
Update your generators
Install a generator
Find some help
Get me out of here!
──────────────

My Generator seem to be avaible, but not :

Make sure you are in the directory you want to scaffold into.
This generator can also be run with: yo starterpack

Error

You don’t seem to have a generator with the name “starterpack:app” installed.

If needed all code are available here : https://github.com/ethyde/generator-starterpack

What I did wrong ?

Thanks.

EDIT : Fixed, thanks, I have updated the repo with the answer.


Solution

  • Your generator is not exporting a standard node module. See this line https://github.com/ethyde/generator-starterpack/blob/master/generators/app/index.js#L77

    Babel by default compile es6 module files to exports.defaults. Yeoman expects a usual Node.js export. In other words, it expects your generator to be exported as module.exports = Generator.

    You'll need to update your babel configuration.