AUTO_PIN should not change to different package manager
What would you like?
Corepack AUTO_PIN should not attempt to automatically change to a different package manager in a project, such as attempting to change an npm project into a Yarn project.
Why is this needed?
~~By default, and if the environment variable COREPACK_ENABLE_AUTO_PIN is not set to 0~~ If COREPACK_ENABLE_AUTO_PIN is set to 1, then Corepack adds a packageManager field to an existing package.json file if the field is not present.
If a project is identifiable through a lock file
| Lock file | Package Manager |
|---|---|
package-lock.json |
npm |
pnpm-lock.yaml |
pnpm |
yarn.lock |
Yarn Classic |
yarn.lock |
Yarn Modern |
then AUTO_PIN should not attempt to add a packageManager field for a different package manager.
Other
- related to https://github.com/nodejs/corepack/issues/691
This issue is now less critical, since the merge of https://github.com/nodejs/corepack/pull/709 and the release of [email protected]
- Disables auto-pinning by default (https://github.com/nodejs/corepack/pull/709) (https://github.com/nodejs/corepack/commit/77fff3c1f3b99c19dcf89cab736d8fb5f1ef85d9)