Closed Marcel-Oramas closed 8 months ago
I have the exact same issue!
Can you please try the JHipster Migrate Blueprint and see if it solves your problem? It worked for me!
@mraible Didn't work using jhipster-migrate, I installed as indicated and executed jhipster-migrate
and the output I got was
Welcome to the JHipster Migrate Sub-Generator
This will help migrate your current application codebase
✔ created branch jhipster_migrate_source
✔ cleaned up project directory
⠋ regenerating source application Running local npx jhipster --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks --with-entities --prefer-global
✖ successfully regenerated source application using JHipster current
ERROR! An error occured while running jhipster-migrate:migrate#prepareMigrateBranch
ERROR! ERROR! Command failed with exit code 1: npx jhipster --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks --with-entities --prefer-global
Error: Command failed with exit code 1: npx jhipster --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks --with-entities --prefer-global
at makeError (file:///Users/julio/.nvm/versions/node/v18.16.0/lib/node_modules/generator-jhipster-migrate/node_modules/execa/lib/error.js:60:11)
at handlePromise (file:///Users/julio/.nvm/versions/node/v18.16.0/lib/node_modules/generator-jhipster-migrate/node_modules/execa/index.js:124:26)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async default.regenerate (file:///Users/julio/.nvm/versions/node/v18.16.0/lib/node_modules/generator-jhipster-migrate/generators/migrate/generator.js:529:9)
at async default.prepareMigrateBranch (file:///Users/julio/.nvm/versions/node/v18.16.0/lib/node_modules/generator-jhipster-migrate/generators/migrate/generator.js:322:11)
at async default.executeTask (file:///Users/julio/.nvm/versions/node/v18.16.0/lib/node_modules/generator-jhipster-migrate/node_modules/yeoman-generator/dist/actions/lifecycle.js:244:13)
at async runLoop.add.once (file:///Users/julio/.nvm/versions/node/v18.16.0/lib/node_modules/generator-jhipster-migrate/node_modules/yeoman-environment/dist/environment-base.js:381:17) {
shortMessage: 'Command failed with exit code 1: npx jhipster --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks --with-entities --prefer-global',
command: 'npx jhipster --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks --with-entities --prefer-global',
escapedCommand: 'npx jhipster --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks --with-entities --prefer-global',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: undefined,
stderr: undefined,
cwd: '/Users/julio/Projects/jhipster_migration/backend',
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
Not sure if I should move this error to the repo from JHipster Migrate Blueprint or leave it here.
I tried using -d
, --debug
to get a better output but it was the same as the one I just shared, is there any other flag to use?
I also tried creating a new branch and executing: npx jhipster --force --skip-install --skip-git --ignore-errors --no-insight --skip-checks --with-entities --prefer-global
and got the following
INFO! Using bundled JHipster
node:internal/modules/cjs/loader:571
throw e;
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/util/namespace' is not defined by "exports" in /Users/julio/Projects/jhipster_migration/backend/node_modules/yeoman-environment/package.json
at new NodeError (node:internal/errors:399:5)
at exportsNotFound (node:internal/modules/esm/resolve:361:10)
at packageExportsResolve (node:internal/modules/esm/resolve:697:9)
at resolveExports (node:internal/modules/cjs/loader:565:36)
at Module._findPath (node:internal/modules/cjs/loader:634:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1061:27)
at Module._load (node:internal/modules/cjs/loader:920:27)
at Module.require (node:internal/modules/cjs/loader:1141:19)
at require (node:internal/modules/cjs/helpers:110:18)
at Object.<anonymous> (/Users/julio/Projects/jhipster_migration/backend/node_modules/generator-jhipster/utils/blueprint.js:19:25) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
Node.js v18.16.0
Can you please try it with Node 16 since that is what JHipster 7 requires?
You can try:
.yo-rc.json
file.jhipster-migrate --verbose
this will pause the generation process step by step.
In another terminal install node 16 when regenerating the application, and install node 18 when generating the upgrade application.
I use n to manage node version, but you can use other tool like nvm.Hello,
A merge between the two suggestions worked.
I had to use JHipster Migrate Blueprint, @mraible is this the new standard way to do the update? I was not aware of it.
I also used Node 16 instead of Node 18 and updated on the .yo-rc.json
from 7.9.3 to 7.9.4.
Didn't use your second suggestion @mshima
One extra thing I had to do was fixing a mapping on an entity, someone left a relation repeated and that was failing too.
Thanks for your help guys!
Overview of the issue
Problem upgrading a jhipster project. I tried removing node_modules and package-lock.json and running npm install. It didn't solve the issue. The project is currently on jhipster version 7.9.3. When running the
npx jhipster upgrade
sub-generator I get the following error, apparently with node (MODULE_NOT_FOUND):Motivation for or Use Case
Reproduce the error
nvm use 16
to switch back to Node 16, which is compatible with the project's current jhipster version 7.9.3npx jhipster upgrade
Related issues
https://github.com/jhipster/generator-jhipster/issues/22617
Suggest a Fix
JHipster Version(s)
7.9.3
JHipster configuration
jhipster info
my-location-app@v0.0.1 /Users/myuser/code/myproject-backend-main-2 └── generator-jhipster@7.9.3
yo-rc.json
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System
MacOS Sonoma 14.1.2 (23B92)