Closed elhoo closed 7 years ago
I really don't understand how this subgenerator works...
I didn't manage to reproduce. Here my logs and hope it will help you to find the cause:
╭─pgrimaud@xps ~/tmp/48-5637 ‹master›
╰─$ yo jhipster:upgrade --verbose
Welcome to the JHipster Upgrade Sub-Generator
This will upgrade your current application codebase to the latest JHipster version
Looking for latest generator-jhipster version...
New generator-jhipster version found: 4.3.0
Git repository detected
Created branch jhipster_upgrade
Cleaned up directory
Installing JHipster 4.1.1 locally
Installed generator-jhipster@4.1.1
Regenerating app with jhipster 4.1.1...
Successfully regenerated app with jhipster 4.1.1
Committed with message "Generated with JHipster 4.1.1"
Checked out branch "master"
Current code recorded as generated with version 4.1.1
Updating generator-jhipster to 4.3.0 . This might take some time...
Updated generator-jhipster to version 4.3.0
Checked out branch "jhipster_upgrade"
Cleaned up directory
Regenerating app with jhipster 4.3.0...
Successfully regenerated app with jhipster 4.3.0
Committed with message "Generated with JHipster 4.3.0"
Checked out branch "master"
Merging changes back to master...
Merge done!
Installing dependencies, please wait...
Upgraded successfully. Please now fix conflicts if any, and commit!
My git status, after the upgrade:
╭─pgrimaud@xps ~/tmp/48-5637 ‹master*›
╰─$ gst
Sur la branche master
Modifications qui ne seront pas validées :
(utilisez "git add <fichier>..." pour mettre à jour ce qui sera validé)
(utilisez "git checkout -- <fichier>..." pour annuler les modifications dans la copie de travail)
modifié : yarn.lock
aucune modification n'a été ajoutée à la validation (utilisez "git add" ou "git commit -a")
My git log:
* ca1bb81 - (HEAD -> master) Merge branch 'jhipster_upgrade' (il y a 3 minutes) <Pascal Grimaud>
|\
| * 89c139f - (jhipster_upgrade) Generated with JHipster 4.3.0 (il y a 3 minutes) <Pascal Grimaud>
* | 90f0823 - Merge branch 'jhipster_upgrade' (il y a 4 minutes) <Pascal Grimaud>
|\ \
| |/
| * c47429d - Generated with JHipster 4.1.1 (il y a 4 minutes) <Pascal Grimaud>
* 63cc34d - Generate entities (il y a 5 minutes) <Pascal Grimaud>
* 1873c39 - Init project (il y a 8 minutes) <Pascal Grimaud>
(END)
I upgrade JHipster and now when I create a project I get the following waring message Warning: Can't resolve all parameters for AlertService in /Users/waqas80/Documents/jhip-proj/testblog/node_modules/ng-jhipster/src/service/alert.service.d.ts: ([object Object], ?, [object Object]). This will become an error in Angular v5.x
Warning: Can't resolve all parameters for InterceptableHttp in /Users/waqas80/Documents/jhip-proj/testblog/node_modules/ng-jhipster/src/interceptor/interceptable-http.d.ts: ([object Object], [object Object], ?). This will become an error in Angular v5.x
Template parse warnings:
The element is deprecated. Use
@waqas80 : it's not related to this issue. So open a new ticket with all information for that.
@waqas80 polluting this thread isn't nice @elhoo I couldn't reproduce your issue, but I got #5649 instead - as they are basically the same problem, I will focus on #5649 and I'm closing this instead (as the other bug is easier to reproduce)
I can't really agree with the reason you close this bug, but anyway - I will reopen this/open another if I still has the problems during the next upgrade (which should contain the #5649)
Yes don't hesitate to... I'm a bit stuck with #5649 also, I'm not sure what the issue is, and that's really hard to test. I can't guarantee this will be solved in the next release, I have very little free time at the moment, so unless someone else works on this, it probably won't be solved soon.
My "workaround" is to keep refreshing the project during the upgrade until it contains the changed package.json and then revert the change... ugly.. but it kind of works..
Hello,
I got the same error when updating from 4.3 to 4.5.1
events.js:163
throw er; // Unhandled 'error' event
^
Error: ERROR! Unable to checkout branch jhipster_upgrade:
error: Your local changes to the following files would be overwritten by checkout:
package.json
Please, commit your changes or stash them before you can switch branches.
Aborting
at Environment.error (/Users/poolebu/.config/yarn/global/node_modules/yeoman-environment/lib/environment.js:89:38)
at constructor.error (/Users/poolebu/.config/yarn/global/node_modules/generator-jhipster/generators/generator-base.js:1514:18)
at gitExec (/Users/poolebu/.config/yarn/global/node_modules/generator-jhipster/generators/upgrade/index.js:60:34)
at /Users/poolebu/.config/yarn/global/node_modules/shelljs/src/exec.js:204:9
at ChildProcess.exithandler (child_process.js:212:5)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at maybeClose (internal/child_process.js:899:16)
at Socket.<anonymous> (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
I am receiving the same error, after running version 4.5.1 upgrade subgenerator from a project generated with 4.4.1
$ yo jhipster:upgrade
Welcome to the JHipster Upgrade Sub-Generator
This will upgrade your current application codebase to the latest JHipster version
Looking for latest generator-jhipster version...
New generator-jhipster version found: 4.5.1
Git repository detected
Created branch jhipster_upgrade
Cleaned up directory
Installing JHipster 4.4.1 locally
Installed generator-jhipster@4.4.1
Regenerating app with jhipster 4.4.1...
Successfully regenerated app with jhipster 4.4.1
Committed with message "Generated with JHipster 4.4.1"
Checked out branch "develop"
Current code recorded as generated with version 4.4.1
Updating generator-jhipster to 4.5.1 . This might take some time...
Updated generator-jhipster to version 4.5.1
Error jhipster:upgrade
ERROR! Unable to checkout branch jhipster_upgrade:
error: Your local changes to the following files would be overwritten by checkout:
package.json
Please commit your changes or stash them before you switch branches.
Aborting
I was able to resolve by committing the changed file, and re-running the upgrade generator
Yes we got the solution (since yesterday !) in another ticket -> can you look for it and add your comment there?
Had to do both yarn upgrade
and @jmlw solution (commit the file and run jhipster upgrade
again). After that it worked perfectly, thank you! and thank you for this amazing framework
Overview of the issue
Executing 'yo jhipster:upgrade' on a up-to-date project (ie. no changed file) I get the following error:
See below for details from the upgrade with --verbose
Motivation for or Use Case
It seems that the package.json is changed on master branch and not on the upgrade branch. All changes should happen in the branch and then after successful upgrade be merged to master (at least as I understood it?).
Reproduce the error
It has happened to me the last few versions (I usually upgrade for every version).
Note that I have two different projects that basically has the same starting point (ie. the same .jh files). Project #1 doesn't have ANY custom code - I use that project to check/verify the upgrade (also, I get quite a good changelog what should be changed...). Project #2 is the project that contains all the custom code.
Project #1 was upgraded without problem. Project #2 got problem.
Related issues
Could not find any
Suggest a Fix
JHipster Version(s)
4.2.0
JHipster configuration
yo jhipster:info Welcome to the JHipster Information Sub-Generator
JHipster Version(s)
JHipster configuration, a
.yo-rc.json
file generated in the root folderEntity configuration(s)
entityName.json
files generated in the.jhipster
directoryFoodPlan.json
FoodPlanPeriod.json
Recipe.json
Statistics.json
Browsers and Operating System
java version "1.8.0" Java(TM) SE Runtime Environment (build 1.8.0-b132) Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
git version 2.11.0 (Apple Git-81)
node: v7.4.0
npm: 4.1.1
bower: 1.8.0
gulp: [21:42:13] CLI version 1.2.2
yeoman: 1.8.5
yarn: 0.19.1
Docker version 17.03.1-ce, build c6d412e
docker-compose version 1.11.2, build dfed245
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryN/A
Browsers and Operating System
Mac
Output from upgrade