Description
Is your feature request related to a problem? Please describe.
There are several discussions about managing package manager version in the past.
At the time of writing, i.e. 2024-07-30, Node.js ships experimental corepack which allows pinning the packageManager field in package.json. It's being used in at least tens of thousands of applications searchable in public code.
There has been asks to make corepack stable since May 2022 nodejs/corepack#104
The PR to enable yarn/pnpm corepack binaries by default in nodejs/node#51886, has moved from most approvals to most declines. There's an open PR to remove corepack too at nodejs/node#51981
The tweets about corepack often go viral, like ones by Matt https://twitter.com/search?q=from%3Amattpocockuk%20corepack&src=typed_query, and then some discussions happen Twitter threads which aren't documented.
Here is some wishlist I would like to share:
- As a Node.js user, I want an built-in way to manage my package manager version, like corepack.
- As a corepack user, I don't want my application which specified
packageManager
field to break. - As a Node.js user, I'm open to experiment with alternatives, like
devEngines
.
Describe the solution you'd like
Based on requirements, and consensus in devEngines
proposal as of July 2024, here is what a good solution may look like:
- Do not break applications which use
packageManager
field. - Implement
devEngines
specification, and provide an easy built-in way for users to use it. This can becorepack
or something else. It doesn't matter as long as it ships with Node.js and is easy to use.
Over time, if there's data that one specification is better than other, then add doc/runtime deprecations and provide a migration path to the preferred one.
Describe alternatives you've considered
- Switch to installing corepack from npm.
- Switch to a different runtime, like Deno/Bun.
Additional context
Originally posted as a tweet in https://twitter.com/trivikram/status/1818303053902307479.
A GitHub issue was created as per response from @wesleytodd
Activity