npm / npm/rfcs

[RRFC] an ability for a package to indicate that it should always be installed as if --save-exact were specified

Open
#349 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
777
Forks
267
PR merge metrics
No merged PRs in 30d

Description

Motivation ("The Why")

Install an exact version of Prettier locally in your project. This makes sure that everyone in the project gets the exact same version of Prettier. Even a patch release of Prettier can result in slightly different formatting, so you wouldn’t want different team members using different versions and formatting each other’s changes back and forth.

-- from Prettier's docs, https://prettier.io/docs/en/install.html#summary

Example

Another example of where this can be really useful is packages whose authors explicitly acknowledge they don't follow semver.
For example, TypeScript. See https://github.com/microsoft/TypeScript/issues/14116

How
Current Behaviour

There is no way to do this.

Desired Behaviour

As a package maintainer, I should be able to specify "exactVersion": true (or "semver": false) in package.json, so that the users automatically get "my-package": "1.2.3" instead of "my-package": "^1.2.3" when they run npm install my-package.

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the desired behavior in this issue and the related RFC #40, focusing on package.json and the npm install flow described here. Done means a package maintainer can declare exactVersion (or an equivalent setting) and npm install records an exact version instead of a caret range.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.