-
Notifications
You must be signed in to change notification settings - Fork 239
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
add "obey user specifier" RFC #547
base: main
Are you sure you want to change the base?
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 normalizedspecifier
is 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.0
topackage.json
(with the defaultsave-prefix
of^
). (note: i'm intentionally not using--save-exact
here, because i wantother
to install using the defaultsave-prefix
).When no
@version
is 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
.