fix(arborist): tag spec should install the exact version#5599
fix(arborist): tag spec should install the exact version#5599gemwuu wants to merge 2 commits intonpm:latestfrom
Conversation
|
I think there is a very specific reason this works the way it does. I am pretty sure this will break every The way npm works now is that if you give it a tag, it resolves that tag and then "remembers" that resolution via lockfile. Whether the tag came from the package.json or part of This does outline another issue and that is package.json files really should not have tags in them, for this very reason. A tag does not obey semver, and can point to anything. It can easily move out from under you and should be considered an antipattern. This change would be a breaking change, and I don't think it's on the roadmap for 9.0. We're trying to make a 9.0 that works for most people who are already using 8, and this would definitely not fall under that criteria. |
|
@wraithgar So, this behavior change will file for now, and integrate on the next major version(npm 10.0)? Should I create an RRFC for further discussion? |
|
Yes at the very least this needs further discussion. |
RRFC: npm/rfcs#640 |
Given
package.jsonbelow:{ "dependencies": { "kewu": "1.0.0", "wuke": "1.0.1" } }The two npm package dependencies are:
kewu@1.0.0has only one dependencywuke@stablewuke@stablerefers towuke@1.0.0Run code below, would only install
wuke@1.0.1into the root dir of node_modules.@npmcli/arboristtreatswuke@1.0.1as the matched version ofwuke@stable, which is wrong.The PR intends to fix this.
As tested, this bug exists from the very beginning implement of arborist.
References