-
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] package-lock issues with workspaces #2505
Comments
This issue has been driving me crazy, heh. On my repo (ts-tools) it doesn't remove any dependencies on the second run, but does add the I end up running |
@targos can you try the latest v7 & see if this is still reproducible? (ie. |
@darcyclarke It is still reproducible with npm v7.5.1. I pushed a new commit to the repro that corresponds to the state after
And there's a similar diff as before (removed packages + added "name" fields) |
I also just realized that the second |
When having optional dependencies of a dependency of a top-level link dependency, e.g: root -> LINK(a) a -> (b) b -> OPTIONAL(c) * c marked as extraneous Any optional dependency (and all its nested nodes) were marked as extraneous in package-lock due to `calcDepFlags` missing properly following the target of Link nodes. This changeset fixes it by properly following the result of the `treeverse.visit` method that will have already followed any link targets at that point. Fixes: npm/cli#2505
should be out in |
The first problem is fixed, but the second one remains. Should I create a new issue for it? |
yes please! that seems like a much lower priority but it would be very nice to make sure we track and fix it in due time! Thank you so much for the report and help @targos 🏆 really appreciated! |
Done: #2700 |
Current Behavior:
After installing the dependencies in an npm workspace for the first time, running
npm install
a second time changes the package-lock.json:Expected Behavior:
Running
npm install
right after creation of the package-lock.json shouldn't change it.Steps To Reproduce:
You can reproduce with the following repo: the last commit contains the package-lock.json created by the first
npm install --legacy-peer-deps
call.Environment:
The text was updated successfully, but these errors were encountered: