Search code examples
javascriptnode.jsnpmyeomanyeoman-generator

Yo generator subgenerator not available. When doing an NPM install it doesn't pull all the code down


I'm working on creating an Yo generator to generate hapijs modules. I've published this to NPM and when I create a new project and do an npm install generator-hapijs, it doesn't pull all the code down into my node_modules/generator-hapijs directory and therefore my subgenerator is not available when doing a yo --help. Why not and how can I fix this?

Here's my code: https://github.com/toymachiner62/generator-hapijs

Here's what's available in my node_modules/generator-hapijs folder when installing this package in a new project:

-/project
--/node_modules
---/generator-hapijs
----/app
----/node_modules
----package.json
----README.md

Solution

  • It had nothing to do with yeoman and yo, but rather had to do with the fact that I had a files array in my package.json and it only contained app so when installing it only installed files from the /app folder.

    I just removed the files array from my package.json file.