-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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] ^7.20.3 no longer resolves local package first on install (workspaces) #3637
Comments
Running into the same issue without even trying to install specific packages inside the workspaces, just running |
I could reproduce the result by using the steps in the issue. Now, I did a bit more digging around and found there are a couple of interesting keys which differ between v7.20.6 and v7.20.2 In the parent node:
I couldn't get any further than this, so if someone who knows the https://github.com/npm/arborist codebase better could help or point me out on where to look, that'd be great! Finally, by the looks of it, this issue would be more relevant to https://github.com/npm/arborist, you could try raising an issue there! |
I had a problem with Gatsby running with Workspaces.
Then adding workspaces in package.json Before dedupe
After dedupe
Despite
This broke my gatsby builds. Unfortunately downgrading to 7.20.2 didn't work for me :( could be a separate issue. My node is v14.17.3 |
Anything we can do to get this fixed? Super annoying bug for us, I need to downgrade npm every few days due to this issue. |
We temporarily updated our CI/CD pipeline to a locked outdated version of NPM to mitigate this: - name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16.x'
# See https://github.com/npm/cli/issues/3637
- run: npm i -g npm@7.20.2 For what it's worth, OSS - Sprint 36 says it's due September 07, so lets hope for the best 🤞🏻 |
Is there any status update to this issue? Will it be fixed? Is it not reproducable on your side? Or will this be the new intended behaviour? Thanks all are actually in the same monorepo: npm WARN |
I'm wondering if the regression that caused this might be related to #3881 |
It seems it works without a package lock, as soon as there is one though, a second npm install fails .. this is such an annoying bug, please let me know what I can contribute to get this fixed. |
Another thing that I discovered: |
I found one workaround that seems to do it for now: we are using "file:../path/to/package" now instead for references to private packages. This is probably not a solution for everyone, but maybe it helps someone. |
For what it's worth, the same problem persists on 8+ (just tested on 8.1.0) |
...to fix releasing npm/cli#3637
omg, we wasted a lot of time yesterday on this (recently upgraded to npm 8) |
'npx npm@7.20.2 install <local_package>' can temporarily solve this problem 😅 |
Hello ! Tested on Windows with: Unfortunately the issue still persists :/ |
This issue still persists and is a major problem IMO when working with workspaces. Is this being looked in to? |
Can we re-open this issue? This error still reproduces in 8.4.0. To reproduce:
Should throw the following error:
Reference #3964 |
ok, i think this pull request will fix the problem for real. #4371 it passes the test in your reproduction repo at least @bigtimebuddy, thank you for that! it was really helpful for tracking this down. |
closing. this fix will be out in our next release later this week |
Can we re-open this issue? The problem is happening again with node 18.14.0 and npm 9.3.1. |
@manolakis have you tried npm 9.5? |
ok, I did a try in modern versions and seems to be fixed in version 9.4.2+ |
I wanted to report that
|
node: v18.14.2 Doesn't work...
|
I am having this issue with npm 9.8.0 as well. |
same here 9.5.1 |
This is happening again on v10.2.0 |
@LoganArnett can you open a new issue with your reproduction for this? |
node/16.14.0 with
has a problem. Upgrade to node/16.20.2 with
fixes the issue. |
FWIW - Node 16.x has reached the end of it's life and should not be used any more. Also npm can be upgraded independently of node by doing |
I am on latest node lts v20.10.0, 10.2.3 and this is still an issue. I suspect it is one with npm, not node though |
No longer an issue on |
actually still a problem with node v22.4.1 and npm v10.8.2 |
Is there an existing issue for this?
Current Behavior
In a workspaces based environment, for example:
Running
npm install b --workspace a
will no longer install the locally linked package correctly. Instead, it'll use the version hosted onnpm
, or throw a 404 if you use a custom (unique) package name.Expected Behavior
In <7.20.x, NPM would resolve the local package, and correctly alter package.json and package-lock.json.
Steps To Reproduce
With
node v16.6.1
andnpm 7.20.3
installed:(I used
@rijk/a
and@rijk/b
as names, to avoid confusion with the existing packagesa
andb
.)npm install
in the root, to give it a chance to npm link all the packages (not sure if needed)@rijk/b
as a dependency of@rijk/a
If you install
7.20.2
or below (npm i -g npm@7.20.2
), the above flow still works as expected.Environment
The text was updated successfully, but these errors were encountered: