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

[DOCS] Explain behavior of "npm install" w/r/t package versions in package-lock.json. #4866

Open
2 tasks done
damellis opened this issue May 6, 2022 · 1 comment
Open
2 tasks done
Labels
Documentation documentation related issue Needs Triage needs review for next steps

Comments

@damellis
Copy link

damellis commented May 6, 2022

Is there an existing issue for this?

  • I have searched the existing issues

This is a CLI Docs Enhancement, not another kind of Docs Enhancement.

  • This is a CLI Docs Enhancement.

Description of Problem

The npm-install documentation for npm 8 doesn't explain the behavior of a no-argument "npm install" with respect to the package versions present in the package-lock.json file.

Potential Solution

Describe how a no-argument "npm install" decides which version of each package to install, when there is a package-lock.json file present. For example, this description from Kat Marchán:

The story about package.json vs package-lock.json is tricky: npm install does not ignore package.json versions, nor does it ignore the package-lock.json. What it does is verify that the package.json and package-lock.json correspond to each other. That is, if the semver versions described in package.json fit with the locked versions in package-lock.json, npm install will use the latter completely, just like npm ci would.

Now, ff you change package.json such that the versions in package-lock.json are no longer valid, your npm install will be treated as if you'd done npm install [email protected], where x.y.z is the new version in the package.json for some-package.

Docs URL

https://docs.npmjs.com/cli/v8/commands/npm-install

@damellis damellis added Documentation documentation related issue Needs Triage needs review for next steps labels May 6, 2022
@damellis
Copy link
Author

damellis commented May 6, 2022

Also, there are apparently some complications around tags and git tags that would be great to document as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation documentation related issue Needs Triage needs review for next steps
Projects
None yet
Development

No branches or pull requests

1 participant