jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.53k stars 4.02k forks source link

Upgrade method is missing parameters #25014

Closed Daszczu closed 8 months ago

Daszczu commented 8 months ago
Overview of the issue

The website lists bunch of params we could pass https://www.jhipster.tech/upgrading-an-application/

To upgrade your application, type:

npx jhipster upgrade

Here are the options you can pass:

--verbose - Log each step of the upgrade process in detail --target-version 6.6.0 - Upgrade to the target version of JHipster instead of the latest release, useful if a project is several versions behind --target-blueprint-versions kotlin@1.4.0,vuejs@1.3.0 - Upgrade to the target blueprints version instead of the latest release of each blueprint. The target version of a blueprint should however be compatible with the target JHipster version. --force - Run the upgrade sub-generator even if no new JHipster version is available --skip-checks - Disable checks during project regeneration --skip-install - Skips installing dependencies during the upgrade process --silent - Hides output of the generation process

However when I try to use it, for example to specify a version I get an error:

npx jhipster upgrade --target-version 7.9.4 error: unknown option '--target-version'

so I wanted to run help to see the supported commands

npx jhipster upgrade --help Usage: jhipster upgrade [options]

Upgrade the JHipster version, and upgrade the generated application

Options: --auto-crlf Detect line endings --skip-cache Do not remember prompt answers (default: false) --skip-install Do not automatically install dependencies (default: false) --force-install Fail on install dependencies error (default: false) --ask-answered Show prompts for already configured options (default: false) -h, --help display help for command

Description: Updates JHipster version, and upgrades generated application

Example:

jhipster upgrade

Assuming you have Git installed, and you run this command in the Git branch you are using for development, JHipster Upgrader will :
- checkout a "jhipster_upgrade" branch
- update generator-jhipster via npm
- regenerate your whole application
- switch back to your development branch, and start the merge

For more info visit https://www.jhipster.tech

And it's completely different

Why is that?

Motivation for or Use Case

I wanna upgrade my jhipster application to specific version

Reproduce the error

Run the command and it fails

Related issues
Suggest a Fix
JHipster Version(s)
JHipster configuration

npx jhipster info

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

██╗ ██║ ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║ ╚██████╔╝ ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗ ╚═════╝ ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝ https://www.jhipster.tech Welcome to JHipster v8.1.0

Welcome to the JHipster Information Sub-Generator

my-project@0.0.0 /home/my-user/project
└── generator-jhipster@8.1.0 invalid: "7.4.0" from the root project
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {

 ...

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



##### **Browsers and Operating System**


Ubuntu 20
- [X] Checking this box is mandatory (this is just to show you read everything)

            
mraible commented 8 months ago

Can you please try the Migrate blueprint to see if it works for you? Use Node 16.

https://github.com/jhipster/generator-jhipster-migrate

ozkanpakdil commented 6 months ago

I have got same error then used "jhipster-migrate" and had issue with ".yo-rc.json" I just accepted what ever the migrator wants, then got error at npm install needed to do some uninstall and install

oz-mint@ozmint-MACH-WX9:~/projects/hamta$ npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: hamta@0.0.1-SNAPSHOT
npm ERR! Found: @testing-library/react@12.1.2
npm ERR! node_modules/@testing-library/react
npm ERR!   dev @testing-library/react@"14.2.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! dev @testing-library/react@"14.2.2" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: react@18.2.0
npm ERR! node_modules/react
npm ERR!   peer react@"^18.0.0" from @testing-library/react@14.2.2
npm ERR!   node_modules/@testing-library/react
npm ERR!     dev @testing-library/react@"14.2.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /home/oz-mint/.npm/_logs/2024-04-06T23_01_05_754Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /home/oz-mint/.npm/_logs/2024-04-06T23_01_05_754Z-debug-0.log
oz-mint@ozmint-MACH-WX9:~/projects/hamta$ npm uninstall @testing-library/react
npm install @testing-library/react@latest

after that I needed to upgrade my code from javax.persistence to jakarta persistence , now the size of the change is huge and admin panel and menu looks like working. this was a very very smooth upgrade. keep up the good work :beers: