Conversation
|
agreed 👍 if the user is specifying a valid semver prefix in along with the package spec when running |
|
👍🏻 removing Agenda flag as we're all in favor of this & have queued this up for |
|
In some case, save tag is expected. Antd mark the stable version with And |
I think there are two modes of operation here, and I would like to see both continued to be supported. Since resolving a version from a dist-tag has explicit behavior today I would love to see a new flag to achieve this behavior, which might need to be a separate RFC, I don't know if @ljharb (or the npm team) would want to bundle that together into this one since it already has agreement. |
|
I agree they're two different things - one is this RFC, which is that the version specifier range should be obeyed; the other is "save the tag vs resolve the tag", and i agree there should be a flag for that. |
When I type
npm install package@specifier, a normalizedspecifieris what should be saved topackage.json, no more, no less.Motivation
Currently, if i type
npm install --save-dev eslint@=8.8.0 other, it installs v8.8.0, but saves^8.8.0topackage.json(with the defaultsave-prefixof^). (note: i'm intentionally not using--save-exacthere, because i wantotherto install using the defaultsave-prefix).When no
@versionis provided, or when a dist-tag is provided, it makes perfect sense to resolve that to a version, and save it withsave-prefix. However, when I've provided a version range -=1.2.3,~1.2.3,>= 1.2- I know what I want, I’ve explicitly told npm I want it, and npm should obey my wishes not just in the reification innode_modules(which I believe it does), but also in what it saves topackage.json.