Commit ffc9b71
docs(npm-install): clarify --tag does not override package.json (#8801)
## Description
This PR clarifies that the `--tag` option for `npm install` only applies
to packages specified on the command line, and does not override version
ranges in `package.json`.
## Changes
- Added a note explaining that `--tag` does not affect dependencies
listed in `package.json`
- Explained that version ranges in `package.json` take precedence over
the `--tag` flag
- Provided an example showing the correct way to install a tagged
version: `npm install foo@beta`
## Context
Users were confused when `npm install --tag beta` didn't install
beta-tagged versions of dependencies listed in `package.json`. The issue
reporter discovered that when `package.json` specifies a version range
like `"^0.3.0"`, the `--tag` flag is ignored and npm installs a version
matching the range, even if the `beta` tag points to a different version
(like `0.4.0-beta.1`). This was marked as needing better
documentation/logging to make the behavior less surprising.
Closes #4685
Co-authored-by: Max Black <husivm@google.com>1 parent 73688ca commit ffc9b71
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
| 318 | + | |
| 319 | + | |
318 | 320 | | |
319 | 321 | | |
320 | 322 | | |
| |||
0 commit comments