[BUG] overrides not working as expected in workspace #4205
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
I am attempting to use the
overrides
support shipped in 8.3 within a project that also usesworkspaces
, but the dependency package version is not being overridden as expected.My reading of the overrides RFC leads me to believe that maybe
overrides
is not currently supported withinworkspaces
? If such is the case, then this may just be a documentation issue. Or maybe I am not correctly identifying the "root package.json file for a project" mentioned in the RFC.I have tried placing my
overrides
in both the workspace'spackage.json
and the package'spackage.json
.But none of these have successfully caused the
package-lock.json
to be generated with the overridden version after I run a freshnpm i
from the workspace root.If I add the
overrides
to the package'spackage.json
and runnpm i
from within the package's directory, then theoverrides
functionality works as expected, but I lose the workspace functionality.Expected Behavior
Given this workspace tree
in the
package.json
of packageb
(and whereb
has a dependency onnode-zopfli
) I expect to be able to put eitheror
to cause
prebuild-install@7
to be used instead ofnode-zopfli
's request forprebuild-install@^5.3.5
.And I expect the
package-lock.json
inworkspace
to reflect this override.Steps To Reproduce
Environment
The text was updated successfully, but these errors were encountered: