jhipster / generator-jhipster-quarkus

Quarkus blueprint for JHipster
https://www.jhipster.tech/blueprints/quarkus/
Apache License 2.0
141 stars 55 forks source link

JHipster quarkus checking JHipster version seems broken #227

Closed danielpetisme closed 3 years ago

danielpetisme commented 3 years ago

Describe the bug When using the Jhipster Quarkus generator from the main branch, the generator fails due to the sanity checks.

To Reproduce Steps to reproduce the behavior:

$ npm install -g generator-jhipster
$ git clone git@github.com:jhipster/generator-jhipster-quarkus.git
$ cd generator-jhipster-quarkus
$ npm install
$ npm link
$ cd ..
$ mkdir my-app && cd my-app
$ npm link generator-jhipster-quarkus
$ jhipster -d --blueprints quarkus

INFO! Using JHipster version installed globally
INFO! No custom sharedOptions found within blueprint: generator-jhipster-quarkus at /usr/local/lib/node_modules/generator-jhipster-quarkus
INFO! No custom commands found within blueprint: generator-jhipster-quarkus at /usr/local/lib/node_modules/generator-jhipster-quarkus
INFO! Debug logging is on
DEBUG!  cmd: lazyBuildCommand app
DEBUG!  cmd: action
     info Using blueprint generator-jhipster-quarkus for app subgenerator

        ██╗ ██╗   ██╗ ████████╗ ███████╗   ██████╗ ████████╗ ████████╗ ███████╗
        ██║ ██║   ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
        ██║ ████████║    ██║    ███████╔╝ ╚█████╗     ██║    ██████╗   ███████╔╝
  ██╗   ██║ ██╔═══██║    ██║    ██╔════╝   ╚═══██╗    ██║    ██╔═══╝   ██╔══██║
  ╚██████╔╝ ██║   ██║ ████████╗ ██║       ██████╔╝    ██║    ████████╗ ██║  ╚██╗
   ╚═════╝  ╚═╝   ╚═╝ ╚═══════╝ ╚═╝       ╚═════╝     ╚═╝    ╚═══════╝ ╚═╝   ╚═╝

             ██████╗ ██╗   ██╗ █████╗ ██████╗ ██╗  ██╗██╗   ██╗███████╗
            ██╔═══██╗██║   ██║██╔══██╗██╔══██╗██║ ██╔╝██║   ██║██╔════╝
            ██║   ██║██║   ██║███████║██████╔╝█████╔╝ ██║   ██║███████╗
            ██║▄▄ ██║██║   ██║██╔══██║██╔══██╗██╔═██╗ ██║   ██║╚════██║
            ╚██████╔╝╚██████╔╝██║  ██║██║  ██║██║  ██╗╚██████╔╝███████║
             ╚══▀▀═╝  ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝ ╚══════╝
                            https://www.jhipster.tech - https://quarkus.io

Welcome to JHipster Quarkus v2.0.0-beta.1
Application files will be generated in folder: /Users/dpetisme/workspace/jhipster/generator-jhipster-quarkus/my-app
 _______________________________________________________________________________________________________________

  Documentation for creating an application is at https://github.com/jhipster/jhipster-quarkus
  If you find JHipster useful, consider sponsoring the project at https://opencollective.com/generator-jhipster
 _______________________________________________________________________________________________________________

ERROR! The installed generator-jhipster-quarkus blueprint targets JHipster v7.1.0 and is not compatible with this JHipster version. Either update the blueprint or JHipster. You can also disable this check using --skip-checks at your own risk
Error: The installed generator-jhipster-quarkus blueprint targets JHipster v7.1.0 and is not compatible with this JHipster version. Either update the blueprint or JHipster. You can also disable this check using --skip-checks at your own risk
    at module.exports.error (/Users/dpetisme/workspace/jhipster/generator-jhipster-quarkus/node_modules/generator-jhipster/generators/generator-base.js:1787:11)
    at module.exports._checkJHipsterBlueprintVersion (/Users/dpetisme/workspace/jhipster/generator-jhipster-quarkus/node_modules/generator-jhipster/generators/generator-base-blueprint.js:420:14)
    at /Users/dpetisme/workspace/jhipster/generator-jhipster-quarkus/node_modules/generator-jhipster/generators/app/index.js:297:18
    at Array.forEach (<anonymous>)
    at module.exports.validateBlueprint (/Users/dpetisme/workspace/jhipster/generator-jhipster-quarkus/node_modules/generator-jhipster/generators/app/index.js:296:42)
    at Object.<anonymous> (/Users/dpetisme/workspace/jhipster/generator-jhipster-quarkus/node_modules/yeoman-generator/lib/index.js:1024:25)
    at /Users/dpetisme/workspace/jhipster/generator-jhipster-quarkus/node_modules/run-async/index.js:49:25
    at new Promise (<anonymous>)
    at /Users/dpetisme/workspace/jhipster/generator-jhipster-quarkus/node_modules/run-async/index.js:26:19
    at runLoop.add.once.once (/Users/dpetisme/workspace/jhipster/generator-jhipster-quarkus/node_modules/yeoman-generator/lib/index.js:1025:11)

$ jhipster info
INFO! Using JHipster version installed globally
Welcome to the JHipster Information Sub-Generator

##### **JHipster Version(s)**

generator-jhipster-quarkus@2.0.0-beta.1 /Users/dpetisme/workspace/jhipster/generator-jhipster-quarkus └── generator-jhipster@7.1.0


cat: no such file or directory: .yo-rc.json

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

<details>
<summary>.yo-rc.json file</summary>
<pre>

</pre>
</details>

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

<details>
<summary>JDL entity definitions</summary>

<pre>

</pre>
</details>

##### **Environment and Tools**

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment GraalVM CE 21.1.0 (build 11.0.11+8-jvmci-21.1-b05)
OpenJDK 64-Bit Server VM GraalVM CE 21.1.0 (build 11.0.11+8-jvmci-21.1-b05, mixed mode, sharing)

git version 2.24.3 (Apple Git-128)

node: v15.14.0

npm: 7.9.0

Docker version 20.10.7, build f0df350

docker-compose version 1.29.2, build 5becea4c

No change to package.json was detected. No package manager install will be executed.

Expected behavior The generation should work.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

N/A

Smartphone (please complete the following information):

N/A

Additional context Add any other context about the problem here.

avdev4j commented 3 years ago

I confirm the bug, reproduced here.

danielpetisme commented 3 years ago

@mshima @mraible did you tried the last version of the main branch? Does it work for you?

mshima commented 3 years ago

Have you tried npm install -g generator-jhipster@7.1.0? jhipster --version?

mshima commented 3 years ago

We probably should update the error message showing current jhipster version too.

avdev4j commented 3 years ago

@mshima It's really strange because now I had run npm install -g generator-jhipster@7.1.0 it works. Previously I ran npm install -g generator-jhipster (7.1.0 is the last one).

mshima commented 3 years ago

If you have generator-jhipster@6 installed, npm install -g generator-jhipster will not update it. You need to execute npm install -g generator-jhipster@latest.

avdev4j commented 3 years ago

but I ran jhipster --version with a successful 7.1.0 version printed.

mshima commented 3 years ago

That's a problem of the local/global workaround:

npm install -g generator-jhipster@6
jhipster --version
INFO! Using JHipster version installed locally in current project's node_modules
7.1.0

I really I hate this behavior when is easy to use jhipster for global and npx jhipster for local. Which is the node standard. I will propose to drop this local/global hack for jhipster 8.

avdev4j commented 3 years ago

hmmm, yep strange because I'm sure I did not have a local installed version.

avdev4j commented 3 years ago

I close this one, since we have a solution