nodejs / nodejs/corepack

Corepack should not append hash to version

Open
#316 12 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.8k
Forks
279
Avg merge
1h 47m
Merged PRs (30d)
2

Description

corepack use and corepack up add build metadata to the version, resulting in a semver string that doesn't match any released version.

e.g. "packageManager": "npm@10.2.0+sha256.c362077587b1e782e5aef3dcf85826399ae552ad66b760e2585c4ac11102243f"

The actual version is simply "10.2.0".

This causes problems for tools that expect to find an existing version: https://github.com/moonrepo/proto/issues/231

Additionally, corepack does not tolerate existing build metadata:

e.g. "packageManager": "npm@9.7.0+some-custom-build"

corepack install
Adding npm@9.7.0+some-custom-build to the cache...
Internal Error: Digest method not supported

Related: https://github.com/npm/cli/issues/1479

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

Start by reproducing corepack use, corepack up, and corepack install with the packageManager values shown in the issue, then trace the version and build-metadata handling. Done means released versions are recorded without an appended hash and existing build metadata no longer causes the digest-method error.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.