`packageManager` field is too limited
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.8k
- Forks
- 279
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 2
Description
The packageManager field as currently designed is too limited for what I want to do:
-
As a project author, I want to enforce a version range, like npm >= 10.0.0.
-
As a project author, I want to control what happens when the developer uses a package manager that fails validation, either because it’s the wrong package manager or a version that’s outside of the defined range:
- Should it warn, but then proceed
- Should it warn, and then prompt to download the newest supported version, and then try again in that version
- Should it error, and exit (like
engines.strict)
-
As a project author, I want to control over package managers based on operations. For example, I want to ensure that
installcommands use the package manager I specify, butruncommands can use any package manager. (So install viapnpmand run scripts via Bun, for example.)
Seeing as this much complexity will require multiple configuration options, I suggest we retire the packageManager field and create a new corepack field that can contain a configuration object with all the necessary fields to cover the various permutations described above.
@nodejs/corepack @nodejs/loaders @nodejs/npm @nodejs/package-maintenance
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by locating the existing packageManager validation and configuration entry points in Corepack, then trace how install and run operations are dispatched. Done means an agreed configuration model covers version ranges, invalid-manager behavior, and per-operation policy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bun, node.js, typescript
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100