-
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.json not updated with new dependencies of a workspace package #1984
Comments
As a workaround to (un)install a package I currently delete all I experimented a lot with npm@7.0 over the last few days and this is the only issue I couldn't really find an acceptable workaround or fix for. |
Arborist wasn't checking for any package.json dep changes within its Link nodes thus preventing users from adding new deps on workspaces. This changeset fixes it and adds a reify test repro. Fixes: npm/cli#1984
@ruyadorno / @isaacs I've just tried out npm
I'm not sure if you want a new issue made or just want to reopen this one. I'm happy to make a new one if required. |
@sheepsteak fyi @isaacs is currently working on a refactor of how @npmcli/arborist handle symlinks and we expect that to fix the remaining issues. Thanks for highlighting these new issues you found, we'll be circling back to make sure all these are working once that code refactor is complete. 😊 |
@ruyadorno was this supposed to solve this issue as well? When I update my package.json in a workspace, and issue an |
Hi @thernstig that sounds like a unsupported usage of npm workspaces, you're not supposed to have a From the looks of it, I believe you have been changing directories and running install from the workspace dir, e.g: That said, may I suggest for now that you just make sure to delete any Adding dep foo to workspace-a
Running build script in workspace-b
Listing dependencies of workspace-a
|
Yeah upvote the RFC/feature. The docs say Nowhere it says DO NOT USE THE NORMAL WAY OF INSTALLING PACKAGES BUT USE THIS. |
Current Behavior:
When using workspaces, it seems
npm install
only detects the dependencies of a workspace package the very first time. Any subsequent changes to thedependencies
ordevDependencies
of workspace package are ignored.Expected Behavior:
If a
dependency
ordevDependency
is added/changed/removed from thepackage.json
of workspace package then runningnpm install
should update thepackage-lock.json
file.Steps To Reproduce:
I made a repository here with instructions - https://github.com/sheepsteak/npm-workspaces-bug.
Environment:
The text was updated successfully, but these errors were encountered: