[BUG] npm i -w <ws> <dep>
sets dependency version to *
in package-lock.json
#5587
Closed
2 tasks done
Labels
Bug
thing that needs fixing
Priority 1
high priority issue
Release 8.x
work is associated with a specific npm 8 release
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Using
npm install -w <workspace> <dep>
, where<dep>
does not include an@
version, then the generatedpackage-lock.json
updates the dependencies for<workspace>
as<dep>@*
.The dependency version is always correctly set in the workspace's
package.json
.If you use
npm i -w <workspace> <dep>@latest
or any specific tag/version, then things behave as expected.Expected Behavior
The version of
<dep>
for<workspace>
inpackage-lock.json
should be set to the version that got installed.Steps To Reproduce
and where the root
package.json
looks like:and
workspaces/a/package.json
looks like:8.19.2
(or even9.0.0-pre.2
)npm i -w a react
package-lock.json
and see:whereas
workspaces/a/package.json
was updated to be:npm i
a second time, then thepackage-lock.json
updates to appear as originally expected:Environment
The text was updated successfully, but these errors were encountered: