npm / npm/cli

`npm install --before` does not ignore `node_modules/.package-lock.json`

Open
#2,643 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Priority 1 Release 10.x Release 7.x Release 8.x Release 9.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Current Behavior:
  1. Go to a repo that has had transitive dep publishes, but hasn’t had any root dep updates.
  2. Run npm install
  3. run rm -rf node_modules/.bin && rm -rf node_modules/* (i usually do this to avoid deleting the node_modules dir and breaking my Dropbox sync settings)
  4. Run npm install --before=$lastRootDepUpdates
  5. See install fail, not finding a transitive dep that was published after the date, but shouldn’t be required, and wouldn’t be on a fresh install.
  6. Run `rm -rf node_modules/.package-lock.json
  7. Run npm install --before=$lastRootDepUpdates
  8. See install pass
Expected Behavior:

Install passes at step 4.

Steps To Reproduce:

See above. I found this in https://github.com/yannickcr/eslint-plugin-react.

Environment:
  • Node: 15.8.0
  • npm: 7.5 (whatever it comes with)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure in the listed eslint-plugin-react scenario with Node 15.8.0, npm 7.5, and npm install --before, comparing behavior before and after removing node_modules/.package-lock.json. Trace how npm install --before handles that file and confirm the install succeeds at step 4 without requiring its removal.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.