Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue upgrading an application from jhipster 7.9.3 to 8.1.0 #24601

Closed
Marcel-Oramas opened this issue Dec 18, 2023 · 6 comments · Fixed by #25203
Closed

Issue upgrading an application from jhipster 7.9.3 to 8.1.0 #24601

Marcel-Oramas opened this issue Dec 18, 2023 · 6 comments · Fixed by #25203

Comments

@Marcel-Oramas
Copy link

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):

INFO! Using bundled JHipster
(node:42971) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./lib/util/" in the "exports" field module resolution of the package at /Users/myuser/code/myproject-backend-main-2/node_modules/yeoman-environment/package.json.
Update this package.json to use a subpath pattern like "./lib/util/*".
(Use `node --trace-deprecation ...` to show where the warning was created)

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

Welcome to the JHipster Upgrade Sub-Generator
This will upgrade your current application codebase to the latest JHipster version
No blueprints detected, skipping check of last blueprint version
Looking for latest generator-jhipster version...
Looking for latest generator-jhipster version...
8.1.0
✔ New generator-jhipster version found: 8.1.0
git rev-parse -q --is-inside-work-tree
true
✔ Git repository detected
git status --porcelain
git rev-parse -q --abbrev-ref HEAD
main
? Unify blueprints configurations? Yes
     info Skipping config upgrade, config generated with jhipster version: 7.9.3
git rev-parse -q --verify jhipster_upgrade
9191c5ba81dec2ff7f9bbc79c90c4334ddceb956
git checkout -q jhipster_upgrade
✔ Checked out branch "jhipster_upgrade"
Installing generator-jhipster 8.1.0 locally
     info npm install [email protected] --save-dev --no-package-lock --ignore-scripts --legacy-peer-deps
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '^18.13.0 || >= 20.6.1', npm: '>=8.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@yeoman/[email protected]',
npm WARN EBADENGINE   required: { node: '>=18.12.0' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '^18.17.0 || >=20.5.0' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '^18.17.0 || >=20.5.0' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.19.2' }
npm WARN EBADENGINE }

added 374 packages, removed 123 packages, changed 108 packages, and audited 2055 packages in 52s

336 packages are looking for funding
  run `npm fund` for details

14 vulnerabilities (7 moderate, 4 high, 3 critical)

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
✔ Installed [email protected]
Skipping blueprint update since no blueprint has been detected
     info Removing /Users/myuser/code/myproject-backend-main-2/.devcontainer
     info Removing /Users/myuser/code/myproject-backend-main-2/.editorconfig
     info Removing /Users/myuser/code/myproject-backend-main-2/.eslintignore
     info Removing /Users/myuser/code/myproject-backend-main-2/.eslintrc.json
     info Removing /Users/myuser/code/myproject-backend-main-2/.gitattributes
     info Removing /Users/myuser/code/myproject-backend-main-2/.gitignore
     info Removing /Users/myuser/code/myproject-backend-main-2/.husky
     info Removing /Users/myuser/code/myproject-backend-main-2/.lintstagedrc.js
     info Removing /Users/myuser/code/myproject-backend-main-2/.prettierignore
     info Removing /Users/myuser/code/myproject-backend-main-2/.prettierrc
     info Removing /Users/myuser/code/myproject-backend-main-2/README.md
     info Removing /Users/myuser/code/myproject-backend-main-2/build.gradle
     info Removing /Users/myuser/code/myproject-backend-main-2/checkstyle.xml
     info Removing /Users/myuser/code/myproject-backend-main-2/gradle
     info Removing /Users/myuser/code/myproject-backend-main-2/gradle.properties
     info Removing /Users/myuser/code/myproject-backend-main-2/gradlew
     info Removing /Users/myuser/code/myproject-backend-main-2/gradlew.bat
     info Removing /Users/myuser/code/myproject-backend-main-2/jest.conf.js
     info Removing /Users/myuser/code/myproject-backend-main-2/npmw
     info Removing /Users/myuser/code/myproject-backend-main-2/npmw.cmd
     info Removing /Users/myuser/code/myproject-backend-main-2/package.json
     info Removing /Users/myuser/code/myproject-backend-main-2/postcss.config.js
     info Removing /Users/myuser/code/myproject-backend-main-2/settings.gradle
     info Removing /Users/myuser/code/myproject-backend-main-2/sonar-project.properties
     info Removing /Users/myuser/code/myproject-backend-main-2/src
     info Removing /Users/myuser/code/myproject-backend-main-2/tsconfig.json
     info Removing /Users/myuser/code/myproject-backend-main-2/tsconfig.test.json
     info Removing /Users/myuser/code/myproject-backend-main-2/webpack
✔ Cleaned up project directory
Regenerating application with JHipster 8.1.0...
node:internal/modules/cjs/loader:988
  throw err;
  ^

Error: Cannot find module '/Users/myuser/code/myproject-backend-main-2/node_modules/shelljs/src/exec-child.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
    at Function.Module._load (node:internal/modules/cjs/loader:833:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:22:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
     info "/jhipster" --with-entities --force --skip-install --skip-git --ignore-errors --no-insight
/bin/sh: /jhipster: No such file or directory
✖ An error occured while running jhipster:upgrade#generateWithTargetVersion
ERROR! Something went wrong while generating project! Error: Command failed: "/jhipster" --with-entities --force --skip-install --skip-git --ignore-errors --no-insight
Error: Something went wrong while generating project! Error: Command failed: "/jhipster" --with-entities --force --skip-install --skip-git --ignore-errors --no-insight
    at module.exports.error (/Users/myuser/code/myproject-backend-main-2/node_modules/generator-jhipster/generators/generator-base.js:1937:11)
    at module.exports._generate (/Users/myuser/code/myproject-backend-main-2/node_modules/generator-jhipster/generators/upgrade/index.js:176:12)
    at module.exports._regenerate (/Users/myuser/code/myproject-backend-main-2/node_modules/generator-jhipster/generators/upgrade/index.js:192:10)
    at module.exports.generateWithTargetVersion (/Users/myuser/code/myproject-backend-main-2/node_modules/generator-jhipster/generators/upgrade/index.js:480:14)
    at Object.<anonymous> (/Users/myuser/code/myproject-backend-main-2/node_modules/yeoman-generator/lib/index.js:1091:23)
    at /Users/myuser/code/myproject-backend-main-2/node_modules/run-async/index.js:49:25
    at new Promise (<anonymous>)
    at /Users/myuser/code/myproject-backend-main-2/node_modules/run-async/index.js:26:19
    at /Users/myuser/code/myproject-backend-main-2/node_modules/yeoman-generator/lib/index.js:1092:9
    at new Promise (<anonymous>)
Motivation for or Use Case
Reproduce the error
  • I move into my project's directory, main branch
  • Run nvm use 16 to switch back to Node 16, which is compatible with the project's current jhipster version 7.9.3
  • Run npx jhipster upgrade
  • I get the above output and the project is left checked out in the jhipster_upgrade branch, with almost no files generated.
Related issues

#22617

Suggest a Fix
JHipster Version(s)

7.9.3

JHipster configuration

jhipster info

WARNING! Since JHipster v8, the jhipster command will not use the locally installed generator-jhipster.
    If you want to execute the locally installed generator-jhipster, run: npx jhipster

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

Welcome to the JHipster Information Sub-Generator


[email protected] /Users/myuser/code/myproject-backend-main-2
└── [email protected]



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


<details>
<summary>.yo-rc.json file</summary>
<pre>
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "session",
    "baseName": "MyLocationApp",
    "blueprints": [],
    "buildTool": "gradle",
    "cacheProvider": "ehcache",
    "clientFramework": "react",
    "clientPackageManager": "npm",
    "clientTheme": "sandstone",
    "clientThemeVariant": "primary",
    "creationTimestamp": 1667566771048,
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "devServerPort": 9060,
    "dtoSuffix": "DTO",
    "enableGradleEnterprise": false,
    "enableHibernateCache": true,
    "enableSwaggerCodegen": false,
    "enableTranslation": true,
    "entities": [
      "Location",
      "Brand",
      "Market",
      "AddressType",
      "Address",
      "AddressBinding",
      "CompanyRole",
      "Company",
      "CompanyBinding",
      "CompanyContact",
      "Site",
      "SiteStatus",
      "CustomFieldGroup",
      "CustomField",
      "ProjectStatus",
      "CustomFieldBinding",
      "ProjectType",
      "Project",
      "Phase",
      "Deliverable",
      "Discipline",
      "ProjectDeliverable",
      "Attachment",
      "ProjectDeliverableApproval",
      "Role",
      "RoleBinding",
      "ProjectTemplate",
      "TemplateDeliverable",
      "TemplateDeliverableApproval",
      "UserSettings",
      "RichComment",
      "AttachmentDerivative",
      "RfiCategory",
      "RfiReason",
      "Rfi",
      "RfiDistribution",
      "AclPermission",
      "Group",
      "GroupBinding",
      "ApplicationFeatureFlag",
      "ChangeOrderReason",
      "ChangeOrderStatus",
      "ChangeOrderRejectionReason",
      "ChangeOrderStatusTransition",
      "Currency",
      "ChangeOrderRevision",
      "ChangeOrder",
      "ChangeOrderTimelineEvent",
      "CostGrouping",
      "CostCategory",
      "CostSubCategory",
      "ChangeOrderItem",
      "Setting",
      "PhotoAlbum",
      "PunchlistCategory",
      "PunchlistStatus",
      "PunchlistReason",
      "PunchlistPage",
      "PunchlistItem",
      "PunchlistGeneration"
    ],
    "entitySuffix": "",
    "jhiPrefix": "jhi",
    "jhipsterVersion": "7.9.3",
    "languages": [
      "en",
      "es"
    ],
    "lastLiquibaseTimestamp": 1699887119000,
    "messageBroker": false,
    "microfrontend": false,
    "microfrontends": [],
    "nativeLanguage": "en",
    "otherModules": [],
    "packageName": "group.mycompany.myproject",
    "pages": [],
    "prodDatabaseType": "postgresql",
    "reactive": false,
    "searchEngine": false,
    "serverPort": "8080",
    "serverSideOptions": [
      "websocket:spring-websocket"
    ],
    "serviceDiscoveryType": "no",
    "skipCheckLengthOfIdentifier": false,
    "skipClient": false,
    "skipFakeData": false,
    "skipUserManagement": false,
    "testFrameworks": [],
    "websocket": "spring-websocket",
    "withAdminUi": true
  }
}
</pre>
</details>


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

openjdk version "17.0.6" 2023-01-17
OpenJDK Runtime Environment Temurin-17.0.6+10 (build 17.0.6+10)
OpenJDK 64-Bit Server VM Temurin-17.0.6+10 (build 17.0.6+10, mixed mode)

git version 2.37.1 (Apple Git-137.1)

node: v20.10.0
npm: 10.2.3

Docker version 24.0.6, build ed223bc

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

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

<pre>
entity Location {
  name String
  city String
  stateProvince String
  openDate LocalDate
  locationNumber String
}
entity Brand {
  description String
}
entity Market {
  description String
}
entity AddressType {
  description String
  main Boolean
  onePerEntity Boolean
}
entity Address {
  streetAddress String
  city String
  stateProvince String
  postalCode String
  country String
  latitude String
  longitude String
  phone String
  email String
  streetAddress2 String
}
entity AddressBinding {
  referenceId Long
  referenceType AddressReferenceEnum
}
entity CompanyRole {
  description String
}
entity Company {
  name String
}
entity CompanyBinding {
  referenceId Long
  referenceType CompanyReferenceEnum
}
entity CompanyContact {
  firstName String
  lastName String
  primary Boolean
}
entity Site {
  name String
  openDate LocalDate
}
entity SiteStatus {
  description String
  order Integer
}
entity CustomFieldGroup {
  name String
  referenceType CustomFieldGroupTypeEnum
  order Integer
}
entity CustomField {
  name String
  label String
  fieldType CustomFieldTypeEnum
  order Integer
  config TextBlob
}
entity ProjectStatus {
  name String
  order Integer
}
entity CustomFieldBinding {
  referenceId Long
  referenceType CustomFieldBindingTypeEnum
  value String
}
entity ProjectType {
  name String required
  order Integer required
}
entity Project {
  projectStatusLastModified Instant required
  procoreId String
}
entity Phase {
  name String
  label String
  order Integer
}
entity Deliverable {
  name String
  isKeyMilestone Boolean
}
entity Discipline {
  name String
}
entity ProjectDeliverable {
  order Integer
  duration Long
  targetStartDate LocalDate
  targetFinishDate LocalDate
  plannedStartDate LocalDate
  plannedFinishDate LocalDate
  actualStartDate LocalDate
  notApplicableFlag Boolean
  completedFlag Boolean
  dependencyOffset Long
  actualFinishDate LocalDate
}
entity Attachment {
  fileName String
  referenceType AttachmentsReferenceEnum
  referenceId Long
  versionReferenceId String
}
entity ProjectDeliverableApproval {
  requestDate LocalDate
  approvedDate LocalDate
  order Integer
}
entity Role {
  name String
}
entity RoleBinding {
  referenceId Long
  referenceType RoleBindingEnum
}
entity ProjectTemplate {
  name String
}
entity TemplateDeliverable {
  order Integer
  duration Integer
  dependencyOffset Integer
}
entity TemplateDeliverableApproval {
  order Integer
}
entity UserSettings {
  settings String
}
entity RichComment {
  payload String
  referenceType RichCommentReferenceEnum
  referenceId Long
}
entity AttachmentDerivative {
  fileName String
  pageNumber Integer
  derivativeType String
}
entity RfiCategory {
  name String required unique
  disabled Boolean required
}
entity RfiReason {
  name String required unique
  disabled Boolean required
}
entity Rfi {
  number Integer required
  questionPayload String required
  status RfiStatusEnum required
  scheduleImpact RfiImpactEnum
  costImpact RfiImpactEnum
  dueDate Instant
}
entity RfiDistribution
entity AclPermission {
  referenceType referenceTypeEnum
  referenceId Long
  aclTargetId Long
}
entity Group (jhi_group) {
  name String
}
entity GroupBinding
entity ApplicationFeatureFlag {
  key String required unique
  description String
  enabled Boolean required
}
entity ChangeOrderReason {
  disabled Boolean
  name String required unique maxlength(100)
}
entity ChangeOrderStatus {
  name String required unique maxlength(50)
}
entity ChangeOrderRejectionReason {
  name String required unique maxlength(100)
  disabled Boolean
}
entity ChangeOrderStatusTransition {
  comments String maxlength(200)
}
entity Currency {
  name String required maxlength(100)
  unit String required maxlength(30)
  symbol String required maxlength(10)
  isoCode String required maxlength(5)
  isoNumber String required maxlength(5)
  active Boolean required
}
entity ChangeOrderRevision {
  description String required
  drawingReference String maxlength(255)
  scheduleImpact Boolean
  scheduleImpactDays Integer
  estimatedCost BigDecimal
  dueDate Instant
  totalCost BigDecimal
}
entity ChangeOrder {
  number Integer required
  currentRevisionId Long
}
entity ChangeOrderTimelineEvent {
  date Instant required
  type ChangeOrderTimelineEventTypeEnum required
  detail String
}
entity CostGrouping {
  name String required maxlength(100)
  order Double required
  code String required maxlength(50)
  glCode String maxlength(50)
  active Boolean
}
entity CostCategory {
  name String required maxlength(100)
  order Double required
  code String required maxlength(50)
  glCode String maxlength(50)
  active Boolean
}
entity CostSubCategory {
  name String required maxlength(100)
  order Double required
  code String required maxlength(50)
  glCode String maxlength(50)
  active Boolean
}
entity ChangeOrderItem {
  description String
  unitsQty Integer required min(1)
  unitCost BigDecimal required
  type ChangeOrderItemTypeEnum required
}
entity Setting {
  key String required maxlength(150)
  value String maxlength(1000)
}
entity PhotoAlbum {
  name String required
  referenceId Long required
  referenceType PhotoAlbumTypeEnum required
  albumDate LocalDate required
  description String
}
entity PunchlistCategory {
  description String required unique
  active Boolean required
}
entity PunchlistStatus {
  status String required unique
  order Integer
  defaultOption Boolean
  finalState Boolean
}
entity PunchlistReason {
  description String required unique maxlength(2550)
  order Integer
  active Boolean required
}
entity PunchlistPage {
  order Integer required unique
  attachmentDerivativePageNumber Integer
  attachmentId Long
}
entity PunchlistItem {
  punchlistNumber Integer required
  description String maxlength(2550)
  markerLocationX Double required
  markerLocationY Double required
  targetCompletionDate LocalDate
  actualCompletionDate LocalDate
}
entity PunchlistGeneration {
  numberOfPages Integer
  status PunchlistGenerationStatus
}
enum AddressReferenceEnum {
  COMPANY,
  CONTACT,
  LOCATION,
  SITE
}
enum CompanyReferenceEnum {
  LOCATION,
  SITE,
  PROJECT
}
enum CustomFieldGroupTypeEnum {
  LOCATION,
  SITE,
  PROJECT
}
enum CustomFieldTypeEnum {
  STRING,
  INTEGER,
  DECIMAL,
  BOOLEAN,
  DATE,
  DATETIME,
  TIME,
  CURRENCY
}
enum CustomFieldBindingTypeEnum {
  LOCATION,
  SITE,
  PROJECT
}
enum AttachmentsReferenceEnum {
  PROJECT,
  PROJECT_DELIVERABLE
}
enum RoleBindingEnum {
  COMPANY,
  LOCATION,
  SITE,
  PROJECT
}
enum RichCommentReferenceEnum {
  PROJECT,
  PROJECT_DELIVERABLE
}
enum RfiStatusEnum {
  OPEN,
  CLOSED
}
enum RfiImpactEnum {
  YES,
  NO,
  POTENTIALLY,
  UNKNOWN
}
enum referenceTypeEnum {
  USER,
  GROUP,
  ROLE,
  COMPANY_ROLE
}
enum ChangeOrderTimelineEventTypeEnum {
  CREATION,
  STATUS_CHANGE,
  INITIAL_REVIEW,
  FINAL_REVIEW,
  FILE_ADDED,
  FILE_REMOVED,
  FIELDS_UPDATE
}
enum ChangeOrderItemTypeEnum {
  MATERIALS,
  LABOR
}
enum PhotoAlbumTypeEnum {
  LOCATION,
  PROJECT,
  SITE
}
enum PunchlistGenerationStatus {
  PENDING,
  FINISHED
}

relationship OneToOne {
  Address{addressType(description)} to AddressType
  Rfi{officialAnswer} to RichComment
  ChangeOrderStatusTransition{previousTransition} to ChangeOrderStatusTransition
  ChangeOrderRevision{previousRevision} to ChangeOrderRevision
  ChangeOrderRevision{lastStatusTransition} to ChangeOrderStatusTransition
}
relationship ManyToOne {
  Location{brand(description)} to Brand
  Location{market(description)} to Market
  AddressBinding{address(streetAddress)} to Address
  CompanyBinding{company(name)} to Company
  CompanyBinding{companyRole(description)} to CompanyRole
  CompanyContact{company(name)} to Company
  Site{location(name)} to Location
  Site{status(description)} to SiteStatus
  CustomField{customFieldGroup(name)} to CustomFieldGroup
  CustomFieldBinding{customFieldId(name)} to CustomField
  Project{site(name) required} to Site
  Project{projectType(name)} to ProjectType
  Project{projectStatus(name)} to ProjectStatus
  Project{template(name)} to ProjectTemplate
  Deliverable{discipline(name)} to Discipline
  Deliverable{role(name)} to Role
  ProjectDeliverable{phase(name)} to Phase
  ProjectDeliverable{deliverable(name)} to Deliverable
  ProjectDeliverable{project} to Project
  ProjectDeliverable{dependency} to ProjectDeliverable
  Attachment{attachment} to Attachment
  ProjectDeliverableApproval{projectDeliverable} to ProjectDeliverable
  ProjectDeliverableApproval{role(name)} to Role
  Role{discipline(name)} to Discipline
  RoleBinding{role(name)} to Role
  TemplateDeliverable{template(name)} to ProjectTemplate
  TemplateDeliverable{deliverable(name)} to Deliverable
  TemplateDeliverable{phase(name)} to Phase
  TemplateDeliverable{dependency} to TemplateDeliverable
  TemplateDeliverableApproval{dependency} to TemplateDeliverable
  TemplateDeliverableApproval{role(name)} to Role
  AttachmentDerivative{attachment} to Attachment
  Rfi{project required} to Project
  Rfi{category(name) required} to RfiCategory
  Rfi{reason(name)} to RfiReason
  RfiDistribution{rfi required} to Rfi
  GroupBinding{group} to Group
  ChangeOrderStatusTransition{status(name) required} to ChangeOrderStatus
  ChangeOrderStatusTransition{rejectionReason(name)} to ChangeOrderRejectionReason
  ChangeOrderStatusTransition{changeOrder required} to ChangeOrder
  ChangeOrderRevision{currency required} to Currency
  ChangeOrderRevision{changeOrder required} to ChangeOrder
  ChangeOrderRevision{relatedRfi} to Rfi
  ChangeOrder{project required} to Project
  ChangeOrder{reason} to ChangeOrderReason
  ChangeOrderTimelineEvent{changeOrder required} to ChangeOrder
  CostCategory{costGrouping required} to CostGrouping
  CostSubCategory{costCategory required} to CostCategory
  ChangeOrderItem{changeOrder required} to ChangeOrder
  ChangeOrderItem{costSubCategory required} to CostSubCategory
  PunchlistPage{project required} to Project
  PunchlistItem{punchlistPage required} to PunchlistPage
  PunchlistItem{punchlistCategory(description) required} to PunchlistCategory
  PunchlistItem{punchlistStatus(status) required} to PunchlistStatus
  PunchlistItem{punchlistReason(description) required} to PunchlistReason
  PunchlistGeneration{project} to Project
}

dto Location, Brand, Market, AddressType, Address, AddressBinding, CompanyRole, Company, CompanyBinding, CompanyContact, Site, SiteStatus, CustomFieldGroup, CustomField, ProjectStatus, CustomFieldBinding, ProjectType, Project, Phase, Deliverable, Discipline, ProjectDeliverable, Attachment, ProjectDeliverableApproval, Role, RoleBinding, ProjectTemplate, TemplateDeliverable, TemplateDeliverableApproval, UserSettings, RichComment, AttachmentDerivative, RfiCategory, RfiReason, Rfi, RfiDistribution, AclPermission, Group, GroupBinding, ApplicationFeatureFlag, ChangeOrderReason, ChangeOrderStatus, ChangeOrderRejectionReason, ChangeOrderStatusTransition, Currency, ChangeOrderRevision, ChangeOrder, ChangeOrderTimelineEvent, CostGrouping, CostCategory, CostSubCategory, ChangeOrderItem, Setting, PhotoAlbum, PunchlistCategory, PunchlistStatus, PunchlistReason, PunchlistPage, PunchlistItem, PunchlistGeneration with mapstruct
paginate Location, Company, CompanyContact, Site, Project, RichComment, RfiCategory, RfiReason, Rfi, RfiDistribution, GroupBinding, ApplicationFeatureFlag, ChangeOrder, PhotoAlbum with pagination
paginate Address, CompanyRole, CompanyBinding, SiteStatus, CustomFieldGroup, CustomField, ProjectStatus, ProjectType, Discipline, Role, RoleBinding, AttachmentDerivative, PunchlistCategory, PunchlistReason, PunchlistPage, PunchlistItem with infinite-scroll
service Location, Brand, Market, AddressType, Address, AddressBinding, CompanyRole, Company, CompanyBinding, CompanyContact, Site, SiteStatus, CustomFieldGroup, CustomField, ProjectStatus, CustomFieldBinding, ProjectType, Project, Phase, Deliverable, Discipline, ProjectDeliverable, Attachment, ProjectDeliverableApproval, Role, RoleBinding, ProjectTemplate, TemplateDeliverable, TemplateDeliverableApproval, UserSettings, RichComment, AttachmentDerivative, RfiCategory, RfiReason, Rfi, RfiDistribution, AclPermission, Group, GroupBinding, ApplicationFeatureFlag, ChangeOrderReason, ChangeOrderStatus, ChangeOrderRejectionReason, ChangeOrderStatusTransition, Currency, ChangeOrderRevision, ChangeOrder, ChangeOrderTimelineEvent, CostGrouping, CostCategory, CostSubCategory, ChangeOrderItem, Setting, PhotoAlbum, PunchlistCategory, PunchlistStatus, PunchlistReason, PunchlistPage, PunchlistItem, PunchlistGeneration with serviceClass
filter Location, Brand, Market, Company, CompanyBinding, CompanyContact, Site, CustomFieldGroup, CustomField, ProjectStatus, CustomFieldBinding, ProjectType, Project, Phase, Deliverable, ProjectDeliverable, Attachment, ProjectDeliverableApproval, Role, RoleBinding, ProjectTemplate, TemplateDeliverable, TemplateDeliverableApproval, UserSettings, Rfi, ChangeOrderRevision, ChangeOrder, PhotoAlbum, PunchlistCategory, PunchlistStatus, PunchlistReason, PunchlistPage, PunchlistItem

</pre>
</details>


Congratulations, JHipster execution is complete!
If you find JHipster useful consider sponsoring the project https://www.jhipster.tech/sponsors/

Thanks for using JHipster!

yo-rc.json

{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "session",
    "baseName": "MyLocationApp",
    "blueprints": [],
    "buildTool": "gradle",
    "cacheProvider": "ehcache",
    "clientFramework": "react",
    "clientPackageManager": "npm",
    "clientTheme": "sandstone",
    "clientThemeVariant": "primary",
    "creationTimestamp": 1667566771048,
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "devServerPort": 9060,
    "dtoSuffix": "DTO",
    "enableGradleEnterprise": false,
    "enableHibernateCache": true,
    "enableSwaggerCodegen": false,
    "enableTranslation": true,
    "entities": [
      "Location",
      "Brand",
      "Market",
      "AddressType",
      "Address",
      "AddressBinding",
      "CompanyRole",
      "Company",
      "CompanyBinding",
      "CompanyContact",
      "Site",
      "SiteStatus",
      "CustomFieldGroup",
      "CustomField",
      "ProjectStatus",
      "CustomFieldBinding",
      "ProjectType",
      "Project",
      "Phase",
      "Deliverable",
      "Discipline",
      "ProjectDeliverable",
      "Attachment",
      "ProjectDeliverableApproval",
      "Role",
      "RoleBinding",
      "ProjectTemplate",
      "TemplateDeliverable",
      "TemplateDeliverableApproval",
      "UserSettings",
      "RichComment",
      "AttachmentDerivative",
      "RfiCategory",
      "RfiReason",
      "Rfi",
      "RfiDistribution",
      "AclPermission",
      "Group",
      "GroupBinding",
      "ApplicationFeatureFlag",
      "ChangeOrderReason",
      "ChangeOrderStatus",
      "ChangeOrderRejectionReason",
      "ChangeOrderStatusTransition",
      "Currency",
      "ChangeOrderRevision",
      "ChangeOrder",
      "ChangeOrderTimelineEvent",
      "CostGrouping",
      "CostCategory",
      "CostSubCategory",
      "ChangeOrderItem",
      "Setting",
      "PhotoAlbum",
      "PunchlistCategory",
      "PunchlistStatus",
      "PunchlistReason",
      "PunchlistPage",
      "PunchlistItem",
      "PunchlistGeneration"
    ],
    "entitySuffix": "",
    "jhiPrefix": "jhi",
    "jhipsterVersion": "7.9.3",
    "languages": ["en", "es"],
    "lastLiquibaseTimestamp": 1699887119000,
    "messageBroker": false,
    "microfrontend": false,
    "microfrontends": [],
    "nativeLanguage": "en",
    "otherModules": [],
    "packageName": "group.mycompany.myproject",
    "pages": [],
    "prodDatabaseType": "postgresql",
    "reactive": false,
    "rememberMeKey": "",
    "searchEngine": false,
    "serverPort": "8080",
    "serverSideOptions": ["websocket:spring-websocket"],
    "serviceDiscoveryType": "no",
    "skipCheckLengthOfIdentifier": false,
    "skipClient": false,
    "skipFakeData": false,
    "skipUserManagement": false,
    "testFrameworks": [],
    "websocket": "spring-websocket",
    "withAdminUi": true
  }
}

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System

MacOS Sonoma 14.1.2 (23B92)

  • [ ✔️] Checking this box is mandatory (this is just to show you read everything)
@julillosamaral
Copy link

I have the exact same issue!

@mraible
Copy link
Contributor

mraible commented Jan 16, 2024

Can you please try the JHipster Migrate Blueprint and see if it solves your problem? It worked for me!

@julillosamaral
Copy link

@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

@mraible
Copy link
Contributor

mraible commented Jan 16, 2024

Can you please try it with Node 16 since that is what JHipster 7 requires?

@mshima
Copy link
Member

mshima commented Jan 17, 2024

You can try:

  • change jhipsterVersion 7.9.3 to 7.9.4 at .yo-rc.json file.
  • use 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.

@julillosamaral
Copy link

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!

@deepu105 deepu105 added this to the 8.2.0 milestone Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants