Search code examples
yeomanyeoman-generatorjhipster

Preparing for Yeoman 1.0 -> this.installDependencies not working anymore


I am working on migrating JHipster to Yeoman 0.20.1, in order to prepare for Yeoman 1.0.

At the end of our process, we normally:

  • Run npm install and bower install
  • Use a callback function to run some Grunt or Gulp.js task, usually grunt wiredep

This has always worked, and here is the current code that runs the installation process.

Since I migrated to Yeoman 0.20.1, we still have:

  • The installDependencies function being called
  • It even prints out the message I'm all done. Running npm install & bower install for you to install the required dependencies. If this fails, try running the command yourself.

But in fact no installation happens! NPM and Bower do not install anything, and our Grunt task is not called. Note that if I call them manually, they work correctly.

If tried to debug this, and it looks like this method is not being called.

Can anybody help me on this issue?


Solution

  • I feel like the run loop might be done after the end event is triggered. installDependencies schedule install methods to be runned during the install priority. If the run loop is done, they won't run.

    You should be able to just call installDependencies at any time and not worry about the end event callback. If you want to imitate the behavior you currently have, then call installDependencies inside a method called end.


    As a side note on the installDependencies API, you don't need to manually specify skipInstall anymore (that's now automatic).