Skip to content
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 update breaks package-lock file #1997

Closed
ruyadorno opened this issue Oct 20, 2020 · 0 comments
Closed

[BUG] npm update breaks package-lock file #1997

ruyadorno opened this issue Oct 20, 2020 · 0 comments
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@ruyadorno
Copy link
Contributor

Current Behavior:

Running npm update removes name, version, dependencies and package[""] from the package-lock.json file.

Expected Behavior:

Running npm update should not remove these expected fields from package-lock.json file

Steps To Reproduce:

in any npm7-powered project:
Run: npm update

@ruyadorno ruyadorno added Release 7.x work is associated with a specific npm 7 release Bug thing that needs fixing Needs Triage needs review for next steps labels Oct 20, 2020
isaacs added a commit to npm/arborist that referenced this issue Oct 20, 2020
This was causing the root metadata (name, version, and the package['']
member) to be missing when we replace the metadata object on the root
node during the buildIdealTree step (which we do for 'npm update' with
no package name args).

Implicitly add the node to the metadata whenever node.meta is set.  This
required a bit of shuffling around and the removal of some cases where
we _were_ explicitly adding the root node, since it is now no longer a
thing that can be forgotten.

Fix: npm/cli#1997
@darcyclarke darcyclarke removed the Needs Triage needs review for next steps label Oct 20, 2020
isaacs added a commit that referenced this issue Oct 23, 2020
- Ensure that root is added when root.meta is set
- Include all edges in explain() output when a root edge exists
- Do not conflict on meta-peers that will not be replaced
- Install peerOptionals if explicitly requested, or dev

Fix: #1997
Fix: #2000
Fix: #2005
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants