nrwl / nx

Smart Monorepos · Fast CI

Home Page:https://nx.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nx migrate to latest Failed to run migration-v18 from @angular/cdk.

Panaith opened this issue · comments

Current Behavior

npx nx migrate latest

Fetching meta data about packages.
It may take a few minutes.
Fetching nx@19.4.2
Fetching nx@19.4.2
Fetching @nx/js@19.4.2
Fetching @nx/angular@19.4.2
Fetching @nx/workspace@19.4.2
Fetching @nx/jest@19.4.2
Fetching @nx/cypress@19.4.2
Fetching @nx/web@19.4.2
Fetching @nx/eslint@19.4.2
Fetching @nx/eslint-plugin@19.4.2
Fetching @nx/js@19.4.2
Fetching @nx/workspace@19.4.2
Fetching @nx/cypress@19.4.2
Fetching @nx/jest@19.4.2
Fetching @nx/angular@19.4.2
Fetching @nx/web@19.4.2
Fetching @nx/eslint-plugin@19.4.2
Fetching @nx/eslint@19.4.2
Fetching @angular/core@18.0.7
Fetching @angular/cdk@18.0.6
Fetching @ngrx/store@18.0.0
Fetching @angular/core@~18.0.0
Fetching @angular/cdk@~18.0.0
Fetching @ngrx/store@^18.0.0
Fetching @ngrx/effects@18.0.0
Fetching @ngrx/store-devtools@18.0.0
Fetching @ngrx/router-store@18.0.0
Fetching @ngrx/entity@18.0.0
Fetching @ngrx/schematics@18.0.0
Fetching @ngrx/entity@18.0.0
Fetching @ngrx/effects@18.0.0
Fetching @ngrx/store-devtools@18.0.0
Fetching @ngrx/router-store@18.0.0
Fetching @ngrx/schematics@18.0.0
Fetching @angular/core@18.0.1
Fetching @angular/core@18.0.1

 NX   The migrate command has run successfully.

- package.json has been updated.
- migrations.json has been generated.


 NX   Connect to Nx Cloud

Nx Cloud is a first-party CI companion for Nx projects. It improves critical aspects of CI:
- Speed: 30% - 70% faster CI
- Cost: 40% - 75% reduction in CI costs
- Reliability: by automatically identifying flaky tasks and re-running them

√ Would you like remote caching to make your build faster? · skip

 NX   Next steps:

- Make sure package.json changes make sense and then run 'npm install',
- Run 'npx nx migrate --run-migrations'
- To learn more go to https://nx.dev/features/automate-updating-dependencies
- You may run 'npm run nx -- connect-to-nx-cloud' to get faster builds, GitHub integration, and more. Check out https://nx.app

npx nx migrate --run-migrations

 NX   Running 'npm install' to make sure necessary packages are installed

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular-devkit/build-angular@18.0.7',
npm WARN EBADENGINE   required: {
npm WARN EBADENGINE     npm: '^6.11.0 || ^7.5.6 || >=8.0.0',
npm WARN EBADENGINE     node: '^18.19.1 || ^20.11.1 || >=22.0.0',
npm WARN EBADENGINE     yarn: '>= 1.13.0'
npm WARN EBADENGINE   },
npm WARN EBADENGINE   current: { node: 'v20.11.0', npm: '10.2.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular-devkit/core@18.0.7',
npm WARN EBADENGINE   required: {
npm WARN EBADENGINE     npm: '^6.11.0 || ^7.5.6 || >=8.0.0',
npm WARN EBADENGINE     node: '^18.19.1 || ^20.11.1 || >=22.0.0',
npm WARN EBADENGINE     yarn: '>= 1.13.0'
npm WARN EBADENGINE   },
npm WARN EBADENGINE   current: { node: 'v20.11.0', npm: '10.2.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular-devkit/schematics@18.0.7',
npm WARN EBADENGINE   required: {
npm WARN EBADENGINE     npm: '^6.11.0 || ^7.5.6 || >=8.0.0',
npm WARN EBADENGINE     node: '^18.19.1 || ^20.11.1 || >=22.0.0',
npm WARN EBADENGINE     yarn: '>= 1.13.0'
npm WARN EBADENGINE   },
npm WARN EBADENGINE   current: { node: 'v20.11.0', npm: '10.2.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@schematics/angular@18.0.7',
npm WARN EBADENGINE   required: {
npm WARN EBADENGINE     npm: '^6.11.0 || ^7.5.6 || >=8.0.0',
npm WARN EBADENGINE     node: '^18.19.1 || ^20.11.1 || >=22.0.0',
npm WARN EBADENGINE     yarn: '>= 1.13.0'
npm WARN EBADENGINE   },
npm WARN EBADENGINE   current: { node: 'v20.11.0', npm: '10.2.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular-devkit/architect@0.1800.7',
npm WARN EBADENGINE   required: {
npm WARN EBADENGINE     npm: '^6.11.0 || ^7.5.6 || >=8.0.0',
npm WARN EBADENGINE     node: '^18.19.1 || ^20.11.1 || >=22.0.0',
npm WARN EBADENGINE     yarn: '>= 1.13.0'
npm WARN EBADENGINE   },
npm WARN EBADENGINE   current: { node: 'v20.11.0', npm: '10.2.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular-devkit/build-webpack@0.1800.7',
npm WARN EBADENGINE   required: {
npm WARN EBADENGINE     npm: '^6.11.0 || ^7.5.6 || >=8.0.0',
npm WARN EBADENGINE     node: '^18.19.1 || ^20.11.1 || >=22.0.0',
npm WARN EBADENGINE     yarn: '>= 1.13.0'
npm WARN EBADENGINE   },
npm WARN EBADENGINE   current: { node: 'v20.11.0', npm: '10.2.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular/build@18.0.7',
npm WARN EBADENGINE   required: {
npm WARN EBADENGINE     npm: '^6.11.0 || ^7.5.6 || >=8.0.0',
npm WARN EBADENGINE     node: '^18.19.1 || ^20.11.1 || >=22.0.0',
npm WARN EBADENGINE     yarn: '>= 1.13.0'
npm WARN EBADENGINE   },
npm WARN EBADENGINE   current: { node: 'v20.11.0', npm: '10.2.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@ngtools/webpack@18.0.7',
npm WARN EBADENGINE   required: {
npm WARN EBADENGINE     npm: '^6.11.0 || ^7.5.6 || >=8.0.0',
npm WARN EBADENGINE     node: '^18.19.1 || ^20.11.1 || >=22.0.0',
npm WARN EBADENGINE     yarn: '>= 1.13.0'
npm WARN EBADENGINE   },
npm WARN EBADENGINE   current: { node: 'v20.11.0', npm: '10.2.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular-devkit/architect@0.1800.7',
npm WARN EBADENGINE   required: {
npm WARN EBADENGINE     npm: '^6.11.0 || ^7.5.6 || >=8.0.0',
npm WARN EBADENGINE     node: '^18.19.1 || ^20.11.1 || >=22.0.0',
npm WARN EBADENGINE     yarn: '>= 1.13.0'
npm WARN EBADENGINE   },
npm WARN EBADENGINE   current: { node: 'v20.11.0', npm: '10.2.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular-devkit/architect@0.1800.7',
npm WARN EBADENGINE   required: {
npm WARN EBADENGINE     npm: '^6.11.0 || ^7.5.6 || >=8.0.0',
npm WARN EBADENGINE     node: '^18.19.1 || ^20.11.1 || >=22.0.0',
npm WARN EBADENGINE     yarn: '>= 1.13.0'
npm WARN EBADENGINE   },
npm WARN EBADENGINE   current: { node: 'v20.11.0', npm: '10.2.4' }
npm WARN EBADENGINE }
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\psarridis\\Repositories\\bossInfo\\bossERP\\Project\\Sources\\Components\\bi\\node_modules\\@nx\\.nx-win32-x64-msvc-5Jftg1s2',
npm WARN cleanup     [Error: EPERM: operation not permitted, unlink 'C:\Users\psarridis\Repositories\bossInfo\bossERP\Project\Sources\Components\bi\node_modules\@nx\.nx-win32-x64-msvc-5Jftg1s2\nx.win32-x64-msvc.node'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'unlink',
npm WARN cleanup       path: 'C:\\Users\\psarridis\\Repositories\\bossInfo\\bossERP\\Project\\Sources\\Components\\bi\\node_modules\\@nx\\.nx-win32-x64-msvc-5Jftg1s2\\nx.win32-x64-msvc.node'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]

> @bi/source@0.0.0 postinstall
> node devextreme-config/devextreme-license-producer.js

-------------------------------------------------------------
Running post-install script to set up devextreme license key.
Devextreme license file already exists under path: ./devextreme-config/devextreme-license.ts
-------------------------------------------------------------

added 92 packages, removed 41 packages, changed 256 packages, and audited 1887 packages in 6m

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

6 vulnerabilities (3 low, 1 moderate, 2 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues, run:
  npm audit fix --force

Run `npm audit` for details.

 NX   Running migrations from 'migrations.json'


 NX   Failed to run migration-v18 from @angular/cdk. This workspace is NOT up to date!


 NX   Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.

Pass --verbose to see the stacktraces.

Command failed: npx nx _migrate --run-migrations

 NX   Command failed: npx nx migrate --run-migrations

Pass --verbose to see the stacktrace.

Command failed: C:\Users\PSARRI~1\AppData\Local\Temp\tmp-21516-mtMTgRQecPVn\node_modules\.bin\nx _migrate --run-migrations

Expected Behavior

Running normally

GitHub Repo

No response

Steps to Reproduce

  1. npx nx migrate latest
  2. npx nx migrate --run-migrations

Nx Report

>  NX   Report complete - copy this into the issue template

   Node   : 20.11.0
   OS     : win32-x64
   npm    : 10.2.4

   nx                 : 18.0.4
   @nx/js             : 18.0.4
   @nx/jest           : 18.0.4
   @nx/linter         : 18.0.4
   @nx/eslint         : 18.0.4
   @nx/workspace      : 18.0.4
   @nx/angular        : 18.0.4
   @nx/cypress        : 18.0.4
   @nx/devkit         : 18.0.4
   @nx/eslint-plugin  : 18.0.4
   @nrwl/tao          : 18.0.4
   @nx/web            : 18.0.4
   @nx/webpack        : 18.0.4
   typescript         : 5.3.3
   ---------------------------------------
   Community plugins:
   @ngrx/effects        : 17.1.0
   @ngrx/entity         : 17.1.0
   @ngrx/router-store   : 17.1.0
   @ngrx/schematics     : 17.1.0
   @ngrx/store          : 17.1.0
   @ngrx/store-devtools : 17.1.0
   devextreme-angular   : 24.1.3
   eslint-plugin-ngrx   : 2.1.4

Failure Logs

NX   Running migrations from 'migrations.json'
 NX   Failed to run migration-v18 from @angular/cdk. This workspace is NOT up to date!
 NX   Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
Pass --verbose to see the stacktraces.
Command failed: npx nx _migrate --run-migrations
 NX   Command failed: npx nx migrate --run-migrations
Pass --verbose to see the stacktrace.
Command failed: C:\Users\PSARRI~1\AppData\Local\Temp\tmp-21516-mtMTgRQecPVn\node_modules\.bin\nx _migrate --run-migrations`

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

The npm WARN EBADENGINE Unsupported engine {..... warnings are due to node version 20.11.0, running the same with node version 20.15.0 does not give these warnings but still gives the same Failure logs.

my package.json file is:

{
  "name": "@bi/source",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "postinstall": "node devextreme-config/devextreme-license-producer.js"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~17.1.0",
    "@angular/common": "~17.1.0",
    "@angular/compiler": "~17.1.0",
    "@angular/core": "~17.1.0",
    "@angular/forms": "~17.1.0",
    "@angular/platform-browser": "~17.1.0",
    "@angular/platform-browser-dynamic": "~17.1.0",
    "@angular/router": "~17.1.0",
    "@angular/cdk": "~17.1.0",
    "@nx/angular": "18.0.4",
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.14.3",
    "@ngrx/effects": "17.1.0",
    "@ngrx/entity": "17.1.0",
    "@ngrx/router-store": "17.1.0",
    "@ngrx/store": "17.1.0",
    "@ngrx/store-devtools": "17.1.0",
    "ngrx-store-logger": "^0.2.4",
    "devextreme": "24.1.3",
    "devextreme-angular": "24.1.3",
    "@azure/msal-angular": "^3.0.10",
    "@azure/msal-browser": "^3.7.0",
    "@microsoft/applicationinsights-web": "~3.0.8",
    "@ngneat/until-destroy": "^10.0.0",
    "@fortawesome/fontawesome-pro": "^6.4.0",
    "@types/uuid": "^9.0.8",
    "url-join": "^5.0.0",
    "moment": "^2.30.1",
    "ngx-flexible-layout": "17.0.4",
    "file-saver": "^2.0.5",
    "jspdf": "^2.5.1",
    "jspdf-autotable": "^3.8.2",
    "jszip": "^3.10.1",
    "ts-util-is": "^2.0.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~17.1.0",
    "@angular-devkit/core": "~17.1.0",
    "@angular-devkit/schematics": "~17.1.0",
    "@angular-eslint/eslint-plugin": "~17.0.0",
    "@angular-eslint/eslint-plugin-template": "~17.0.0",
    "@angular-eslint/template-parser": "~17.0.0",
    "@angular/cli": "~17.1.0",
    "@angular/compiler-cli": "~17.1.0",
    "@angular/language-service": "~17.1.0",
    "@nx/cypress": "18.0.4",
    "@nx/eslint": "18.0.4",
    "@nx/eslint-plugin": "18.0.4",
    "@nx/jest": "18.0.4",
    "@nx/js": "18.0.4",
    "@nx/web": "18.0.4",
    "@nx/workspace": "18.0.4",
    "@schematics/angular": "~17.1.0",
    "@swc-node/register": "~1.8.0",
    "@swc/core": "~1.3.85",
    "@swc/helpers": "~0.5.2",
    "@types/jest": "^29.4.0",
    "@types/node": "18.16.9",
    "@typescript-eslint/eslint-plugin": "^6.13.2",
    "@typescript-eslint/parser": "^6.13.2",
    "cypress": "^13.0.0",
    "eslint": "~8.48.0",
    "eslint-config-prettier": "^9.1.0",
    "eslint-plugin-cypress": "^2.13.4",
    "eslint-plugin-import": "^2.29.1",
    "eslint-plugin-ngrx": "^2.1.4",
    "jest": "^29.4.1",
    "jest-environment-jsdom": "^29.4.1",
    "jest-preset-angular": "~13.1.4",
    "jsonc-eslint-parser": "^2.1.0",
    "nx": "18.0.4",
    "prettier": "^3.3.2",
    "ts-jest": "^29.1.0",
    "ts-node": "10.9.1",
    "typescript": "~5.3.2",
    "@ngrx/schematics": "17.1.0",
    "@types/file-saver": "^2.0.7",
    "@types/url-join": "^4.0.3"
  }
}

Thanks for reporting this!

From which Nx version are you migrating from? It looks like the package.json you shared was the final one after running nx migrate latest. Could you provide the initial state instead?

I updated the package.json information in the main post, so that is not misleading anymore (sorry for that).
The provided package.json now is the initial state of the app.

Thanks for the updated package.json!

Unfortunately, I still couldn't reproduce the issue. Based on the provided information, I tried the following:

  • created a new Nx 18.0.4 workspace with Angular
  • replaced dependencies and devDependencies with the provided package.json ones
  • ran npx nx migrate latest
  • ran npx nx migrate --run-migrations

The migrations ran successfully. You can see the output logs by expanding the section below:

`npx nx migrate --run-migrations` output logs
> npx nx migrate --run-migrations

 NX   Running 'npm install' to make sure necessary packages are installed

added 187 packages, removed 86 packages, changed 117 packages, and audited 1728 packages in 2m

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

found 0 vulnerabilities

 NX   Running migrations from 'migrations.json'

    Skipping migration for project app1-e2e. Unable to determine 'tsconfig.json' file in workspace config.

      ✓  Updated Angular CDK to version 18

Ran ngrx-effects-migration-18-beta from @ngrx/effects
  As of NgRx v18, the `concatLatestFrom` import has been removed from `@ngrx/effects` in favor of the `@ngrx/operators` package.

  UPDATE package.json
---------------------------------------------------------
Ran update-angular-cli-version-17-2-0 from @nx/angular
  Update the @angular/cli package version to ~17.2.0.

  UPDATE package.json
---------------------------------------------------------
Ran move-default-base-to-nx-json-root from nx
  Moves affected.defaultBase to defaultBase in `nx.json`

  UPDATE nx.json
---------------------------------------------------------
Ran update-angular-cli-version-17-3-0 from @nx/angular
  Update the @angular/cli package version to ~17.3.0.

  UPDATE package.json
---------------------------------------------------------
Ran update-angular-cli-version-18-0-0 from @nx/angular
  Update the @angular/cli package version to ~18.0.0.

  UPDATE package.json
---------------------------------------------------------
NOTE: The configuration for @typescript-eslint/no-extra-semi and no-extra-semi that you were previously inheriting from the Nx eslint-plugin has been explicitly added to your .eslintrc.json file.

This is because those rules have been migrated to the https://eslint.style/ project (for stylistic only rules) and will no longer work in v8 of typescript-eslint. Having them explicitly in your config will make it easier for you to handle the transition, either by starting to use the ESLint Stylistic plugin, or removing the rules from your config.
Ran update-19-1-0-rename-no-extra-semi from @nx/eslint-plugin
  Migrate no-extra-semi rules into user config, out of nx extendable configs

  UPDATE .eslintrc.json
---------------------------------------------------------
Ran 19-2-0-move-graph-cache-directory from nx
  Updates the default workspace data directory to .nx/workspace-data

  UPDATE .gitignore
  UPDATE .prettierignore
---------------------------------------------------------
Ran add-typescript-eslint-utils from @nx/angular
  Installs the '@typescript-eslint/utils' package when having installed '@angular-eslint/eslint-plugin' or '@angular-eslint/eslint-plugin-template' with version >=18.0.0.

  UPDATE package.json
---------------------------------------------------------
Ran update-angular-cli-version-18-1-0 from @nx/angular
  Update the @angular/cli package version to ~18.1.0.

  UPDATE package.json
---------------------------------------------------------

 NX   Running 'npm install' to make sure necessary packages are installed


added 69 packages, removed 30 packages, changed 10 packages, and audited 1767 packages in 24s

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

found 0 vulnerabilities

 NX   Successfully finished running migrations from 'migrations.json'. This workspace is up to date!

I also used a similar environment to the one you reported:

Node   : 20.11.1
OS     : win32-x64
npm    : 10.2.4

You can try running with the --verbose flag to see if there's any extra information that can help, but we'll most likely need a repo where the issue can be reproduced so we can troubleshoot it.