[BUG] presence of overrides
breaks ability to downgrade un-hoisted workspace dependencies
#7028
Open
2 tasks done
Labels
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
If the root
package.json
defines anyoverrides
, if you attempt to downgrade an un-hoisted workspace dependency via the CLI (e.g.npm install <specifierWithOlderVersion> --save-exact -w <workspace>
), the command succeeds but nothing actually happens. Note that this only affects downgrades, you can upgrade to a newer version.Related to #7018 and exacerbated by #7019
Expected Behavior
Invoking the CLI to install a package should either 1. install the package or 2. display an error message explaining why it could not be installed.
Steps To Reproduce
Given
package.json
:And
packages/my-cool-package/package.json
:Run:
npm i tiny-invariant@0.0.2 --save-exact -w my-cool-package
(hoisted tonode_modules/tiny-invariant
)npm i tiny-invariant@0.0.3 --save-exact -w my-cool-package
(un-hoisted topackages/my-cool-package/node_modules/tiny-invariant
, seemingly due to [BUG] presence ofoverrides
prevents hoisting when updating workspace dependencies #7019)npm i tiny-invariant@0.0.2 --save-exact -w my-cool-package
0.0.3
is still installed, and thepackage*.json
files are unchanged since step 2Environment
The text was updated successfully, but these errors were encountered: