Generator-jhipster: Updating global JHipster doesn't work (on Windows)

Created on 11 Apr 2018  ยท  18Comments  ยท  Source: jhipster/generator-jhipster

Overview of the issue

Updating JHipster does not work.

Motivation for or Use Case

I want to use the most up-to-date version.

Reproduce the error

Run yo jhipster. A new version is available. Run npm install -g generator-jhipster. Open a new terminal. Run yo jhipster. The version is not updated. A video showing the steps can be seen here: https://www.youtube.com/watch?v=8OV3Mf2gCW4 (Note: This does not showcase the bug, only the update steps).

Related issues

No.

Suggest a Fix

Make the update work as expected so running an update with v4.14.2 installs v4.14.3 and uses it from that moment.

JHipster Version(s)

v4.14.2

JHipster configuration

None.

Entity configuration(s) entityName.json files generated in the .jhipster directory

None.

Browsers and Operating System

Windows 10 64bit.

  • [x] Checking this box is mandatory (this is just to show you read everything)

Most helpful comment

Yeah, @gmarziou your last message solved it. Thank you.

All 18 comments

That's normal, because you use the version local to your project, and the global one. Have a look at the documentation, probably the jhipster upgrade sub-generator is what's best for you (that mostly depends if that's a major or minor upgrade).

Just to give some background: we do this for people who have multiple JHipster projects. You might not want to upgrade them all at once. So we use the project-local version, and the global one is ignored, unless of course you force it.

False. I have no project setup. The folder is empty and I cannot update the version. Please let me know why it doesn't work. It always stays at v4.14.2.

Then it totally depends on how you install it - we have guidelines for bugs, please give more information, we can't work like that. Are you using Chocolatey?

No. I just use npm. It's described above under Reproduce the error. I'm not sure what would be missing on how to describe the installation and upgrade procedure.

Yes but you could have installed with Chocolatey, and then try to upgrade with NPM... which would in fact work.
So can you run jhipster info, so we know your configuration?

Here is the jhipster info output:

Using JHipster version installed globally
Executing jhipster:info
Options:

JHipster Version(s)
D:\Programs\Source Codes\Java\IntelliJ\Test
`-- (empty)

##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**
.yo-rc.json file

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory


JDL entity definitions





Environment and Tools

java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

git version 2.6.1.windows.1

node: v9.11.1

npm: 5.6.0

bower: 1.8.0

gulp:
[23:04:00] CLI version 3.9.1

yeoman: 2.0.1

yarn: 1.5.1

Congratulations, JHipster execution is complete!

@BullyWiiPlaza the video you refer to is 2 years old and uses JHipster 3. Since we no longer use yo jhipster please use jhipster without yo .

Also you use JDK 9 which is not supported by JHipster 4.

You're using a non-LTS Node version, and we always recommend to use an LTS version.
What happens when you do npm install -g generator-jhipster, do you have a log? Please note we recommend Yarn, we have only about 5% of users using NPM (so combining Windows + non-LTS NodeJS version + NPM means you are probably a bit alone..)

You ran jhipster info in an empty dir it seems as there's no .yo-rc.json and there's no version printed which could mean that node_modules sub folder is empty.

Please start from scratch, create an empty directory and generate a project here using jhipstercommand.

Even without using yo, it still does not update whatsoever. Here is the terminal output:

D:\Programs\Source Codes\Java\IntelliJ\Test>npm install -g generator-jhipster
C:\Users\User\AppData\Roaming\npm\jhipster -> C:\Users\User\AppData\Roaming\npm\node_modules\generator-jhipster\cli\jhipster.js

> [email protected] postinstall C:\Users\User\AppData\Roaming\npm\node_modules\generator-jhipster
> opencollective postinstall


     *** Thank you for using generator-jhipster! ***

Please consider donating to our open collective
     to help us maintain this package.

  https://opencollective.com/generator-jhipster/donate

                    ***

+ [email protected]
updated 1 package in 20.957s

D:\Programs\Source Codes\Java\IntelliJ\Test>jhipster
Using JHipster version installed globally
Running default command
Executing jhipster:app
Options:


        โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
        โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘ โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ• โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ• โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ• โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—
        โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘    โ–ˆโ–ˆโ•‘    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—     โ–ˆโ–ˆโ•‘    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•
  โ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•‘    โ–ˆโ–ˆโ•‘    โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•   โ•šโ•โ•โ•โ–ˆโ–ˆโ•—    โ–ˆโ–ˆโ•‘    โ–ˆโ–ˆโ•”โ•โ•โ•โ•   โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘
  โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘       โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•    โ–ˆโ–ˆโ•‘    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘  โ•šโ–ˆโ–ˆโ•—
   โ•šโ•โ•โ•โ•โ•โ•  โ•šโ•โ•   โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•       โ•šโ•โ•โ•โ•โ•โ•     โ•šโ•โ•    โ•šโ•โ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•   โ•šโ•โ•

                            http://www.jhipster.tech

Welcome to the JHipster Generator v4.14.2
 _______________________________________________________________________________________________________________

  If you find JHipster useful consider supporting our collective https://opencollective.com/generator-jhipster
  Documentation for creating an application: http://www.jhipster.tech/creating-an-app/
 _______________________________________________________________________________________________________________

Application files will be generated in folder: D:\Programs\Source Codes\Java\IntelliJ\Test
WARNING! Java 1.8 is not found on your computer. Your Java version is: 9.0.1
 ______________________________________________________________________________

  JHipster update available: 4.14.3 (current: 4.14.2)

  Run yarn global upgrade generator-jhipster to update.

 ______________________________________________________________________________

? Which *type* of application would you like to create? (Use arrow keys)
> Monolithic application (recommended for simple projects)
  Microservice application
  Microservice gateway
  JHipster UAA server (for microservice OAuth2 authentication)
D:\Programs\Source Codes\Java\IntelliJ\Test>

I'm updating, it says that v4.14.3 is installed but then it always goes back to v4.14.2.

Edit: Thank you for the additional tips, I will try them.

Maybe you have Node installed twice, or a mix of npm/yarn... It's hard to tell, but that's an npm install problem, clearly.
(and I'm not saying it's easy, it took me very long to have something nicely setup on my Mac)

Yes generator-jhipster being installed twice by both yarn and npm would result in this situation, I had this also on Windows. Another hypothesis is a bad PATH.

Try running yarn global remove generator-jhipster and npm uninstall -g generator-jhipster then re-install it with the one you want and stay with it.

Yeah, @gmarziou your last message solved it. Thank you.

So finally, your PC is not haunted, I began to think so after your issue with H2 ๐Ÿ˜†

@gmarziou your advice is great, works perfect. I have same problem, locked on 4.14.2. cannot upgrade. Thanks a lot. save a lot of time.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pascalgrimaud picture pascalgrimaud  ยท  4Comments

frantzynicolas picture frantzynicolas  ยท  3Comments

Steven-Garcia picture Steven-Garcia  ยท  3Comments

RizziCR picture RizziCR  ยท  3Comments

pascalgrimaud picture pascalgrimaud  ยท  3Comments