Open nsbarsukov opened 4 months ago
I was always wondering why the npm i command, when used in the NX Plugins, removes some packages.
But perhaps this is quite important?
E.g. when upgrading packages from one version to another. Without the legacy peer deps the install might fail, as some packages will get their new version only after the upgrade (e.g. Angular CLI Version gets only upgraded during the actual migration execution)
Maybe an npm i -f might be a solution?
Workaround is to run npm install
yourself:
npm install
NX_MIGRATE_SKIP_INSTALL=true npx nx _migrate --run-migrations --if-exists
I plan to make this a script in my root package.json.
Another workaround is:
npm_config_legacy_peer_deps=false npx nx migrate --run-migrations --if-exists
Current Behavior
Use project without
legacy-peer-deps=true
.Run the following command
it logs:
and then throws error:
(actually, this dependency
node_modules/ts-morph
existed before runningnx migrate --run-migrations
).Use the following command instead
Everything is okay, no error.
Expected Behavior
Default command
works without error for default project configuration (without
legacy-peer-deps=true
).GitHub Repo
https://github.com/taiga-family/maskito/pull/1337
Steps to Reproduce
Clone this repository https://github.com/taiga-family/maskito
Switch to branch
nx-legacy-peer-deps-demo
Run the following commands
It will throw error
Then revert changes inside
package-lock.json
and run againnpm ci
.Run the following command
Everything is okay, no error.
Read more in-depth description in the body of this PR:
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
Probably, the problem relates to the following lines from
nx
-library: