-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] npm workspaces wrong dependancies tree #4056
Comments
I am running into the same (hopefully similar) problem. We've switched to NPM workspaces and suddenly our tests are failing because of (I think) a wrong dependency requirement. Install these dependencies into a package A as a dev dependency:
@opentelemetry/api get's installed in the package A node_modules folder. Install Now
I can confirm: This issue is present on latest 8 and 7.24.2 too! As soon as I force (which is not a workaround!) having multiple versions installed of other packages (@opentelemetry/instrumentation etc) in the package A node_modules folder, the test passes again and require will use the correct version. I then have 0.24 in root folder and 0.26 in workspace folder. Are there known (none hacky!) workarounds? Thanks a lot! |
Looks related to #2989? |
Note that the
|
@Eomm this is a bug in @kirrg001 i'm not able to reproduce your issue, can you open a new issue and include step-by-step instructions to reproduce the problem you're seeing? that will help a lot with our investigation. thanks! |
Since the project I was working on run |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
The dependencies installation order in an npm workspaces project, build a wrong
node_modules/
tree compared to thenpm ls
one.Installing
jest@latest
(v27) the module is installed into:Then, installing
react-scripts@latest
(v4) into another workspace's package the resulting tree for the sub dependencybabel-jest
:But the output is the following:
The
[email protected]
module is installed into theroot/node_modules/react-scripts/node_modules/babel-jest
folder.It triggers a loading error because the
react-scripts
module intopkg-b
loads the:Instead of
Expected Behavior
I would expect a
root/pkg-b/node_modules/babel-jest
installation and not into theroot/node_modules/react-scripts/node_modules/babel-jest
.Steps To Reproduce
Environment
Github action (all OSs and npm 8.1.3 and 7.24.2)
https://github.com/Eomm/npm-stuck/actions/runs/1472468210
The text was updated successfully, but these errors were encountered: