可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I updated my JHipster installation as per this page by running the command
npm update -g generator-jhipster
But to update my application I am not sure where should I run the next command yo jhipster.
I tried running it from the root of existing project, but it asked me to enter the name of the new project.
I tried running it at one level above the root of existing project, then also it asked me the name of the new project. But this time I entered the same name and the jhipster generation process ran. However there was no change in any of the major files like package.json or Gruntfile.js or bower.json
What is the correct way to update a JHipster project, once the JHipster generator is updated?
回答1:
JHipster developers replied over twitter saying that yo jhipster has to be executed at the project root folder.
回答2:
Following [jhipster releases] (https://jhipster.github.io/2015/05/31/jhipster-release-2.14.2.html): How to upgrade
Update your version of JHipster with:
npm update -g generator-jhipster
And then you can update your project when you run again
yo jhipster
You can also update your entities by running again the entity sub-generator, for example if your entity is named Foo
yo jhipster:entity Foo
回答3:
JHipster now has a page on Upgrading an application.
https://jhipster.github.io/upgrading-an-application/
TL;DR
Running the upgrade sub-generator
Go into the application’s root directory:
cd myapplication/
To upgrade your application, type:
yo jhipster:upgrade
If you want to run the upgrade sub-generator even if no new JHipster version is available, type:
yo jhipster:upgrade --force
回答4:
If you want to update all entities you need to run
yo jhipster --with-entities
from the root of your project