nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.75k stars 2.37k forks source link

migrate latest no longer works if @nx/linter is a depencency #28873

Closed el-davo closed 1 week ago

el-davo commented 1 week ago

Current Behavior

When running pnpm nx migrate latest we get an error when @nx/linter is a dependency

Expected Behavior

No error should occur

GitHub Repo

No response

Steps to Reproduce

1.

Nx Report

Node           : 18.20.4
OS             : linux-x64
Native Target  : x86_64-linux
pnpm           : 7.33.4

nx                 : 20.0.8
@nx/js             : 20.0.8
@nrwl/js           : 19.8.4
@nx/jest           : 20.0.8
@nx/linter         : 19.8.4
@nx/eslint         : 20.0.8
@nx/workspace      : 20.0.8
@nrwl/workspace    : 19.8.4
@nx/angular        : 20.0.8
@nx/cypress        : 20.0.8
@nx/devkit         : 20.0.8
@nrwl/devkit       : 19.8.4
@nx/esbuild        : 20.0.8
@nx/eslint-plugin  : 20.0.8
@nx/express        : 20.0.8
@nx/node           : 20.0.8
@nx/playwright     : 20.0.8
@nx/plugin         : 20.0.8
@nx/storybook      : 20.0.8
@nrwl/tao          : 19.8.4
@nx/vite           : 20.0.8
@nx/web            : 20.0.8
@nx/webpack        : 20.0.8
typescript         : 5.5.3
---------------------------------------
Community plugins:
@jsverse/transloco   : 7.4.3
@ngrx/effects        : 18.0.2
@ngrx/operators      : 18.0.2
@ngrx/router-store   : 18.0.2
@ngrx/store          : 18.0.2
@ngrx/store-devtools : 18.0.2
@storybook/angular   : 8.2.9
ngx-build-plus       : 13.0.1
ngx-toastr           : 16.2.0
---------------------------------------
Local workspace plugins:
         workspace-plugin
---------------------------------------
The following packages should match the installed version of nx
  - @nrwl/js@19.8.4
  - @nx/linter@19.8.4
  - @nrwl/workspace@19.8.4
  - @nrwl/devkit@19.8.4
  - @nrwl/tao@19.8.4

To fix this, run `nx migrate nx@20.0.8`

Failure Logs

pnpm nx migrate latest
> nx "migrate" "latest"
Fetching meta data about packages.
It may take a few minutes.
Fetching nx@20.0.12
Fetching nx@20.0.12
Fetching @nx/linter@20.0.12
Fetching @nx/eslint-plugin@20.0.12
Fetching @nx/express@20.0.12
Fetching @nx/js@20.0.12
Unable to fetch migrations for @nx/linter@20.0.12: Command failed: npm install @nx/linter@20.0.12
npm error code ETARGET
npm error notarget No matching version found for @nx/linter@20.0.12.
npm error notarget In most cases you or one of your dependencies are requesting
npm error notarget a package version that doesn't exist.
npm error A complete log of this run can be found in: /.npm/_logs/2024-11-10T08_14_53_529Z-debug-0.log
 NX   The migrate command failed.
 NX   Cannot read properties of undefined (reading 'schematics')
Pass --verbose to see the stacktrace.
Command failed: /tmp/tmp-143-WIiKaLvmjONM/node_modules/.bin/nx _migrate latest
 ELIFECYCLE  Command failed with exit code 1.

Package Manager Version

pnpm@7.33.4

Operating System

Additional Information

Using wsl.

As a workaround we do the following steps

el-davo commented 1 week ago

Closing as we migrated to @nx/eslint instead of @nx/linter after reading the deprecation notice here - https://www.npmjs.com/package/@nx/linter