Skip to content

[RRFC] Obey the specific dist-tag #606

@gemwuu

Description

@gemwuu

Motivation ("The Why")

Since @ljharb has already proposed an RRFC of obey user specifier, which will be implemented at the next major version of npm@9.

In my cases, when installing a new dependency using npm install antd@conch, I want my antd to keep the exact conch dist-tag in my package.json, because this is exactly the version I need in my project. By saying version, I mean the version conch points to, not the moment I run the install command.

And in the obey user specifier RRFC, @wesleytodd suggested a new flag to support that behavior is more reasonable.

Example

Assuming the dist-tag conch of antd currently binding to the exact version 4.20.7.

How

Current Behaviour

  1. Running npm install antd@conch should save the semantic versioning into package.json, hence ^4.20.7 shall be saved;
  2. Running npm install antd@conch --save-exact should save the exact version into package.json, hence 4.20.7 shall be saved.

Desired Behaviour

  1. Running npm install antd@conch --force should save the dist-tag into package.json, hence conch shall be saved;

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions