corepack
corepack copied to clipboard
Cannot run `pnpm dist-tag react` in a pnpm configured project
pnpm dist-tag will delegate the command to npm dist-tag and cause an error.
pnpm dist-tag react
Usage Error: This project is configured to use pnpm
$ npm ...
I suggest making some commands that can be run in any project like dist-tag because they do not do anything related to the project.
That's an interesting one, didn't know pnpm delegates commands to npm 🤔 cc @zkochan
Yes, we do currently pass through to npm CLI some of the commands. We might implement them in pnpm in the future but it is not high priority.
Can we run npm with some option or env variable to skip the check?
I'd also like some sort of env variable to skip the check. Two examples:
Can't install global packages using npm. Some tools rely on running ng directly without the yarn prefix. This can be worked around by cding to some directory where yarn isn't set up as the PM.
➜ npm install -g @angular/cli
Usage Error: This project is configured to use yarn
$ npm ...
And most importantly, release-it delegates to npm to publish packages. In a yarn project it cannot be used:

I'd also like some sort of env variable to skip the check.
There is one: COREPACK_ENABLE_STRICT=0
https://github.com/nodejs/corepack/blob/main/README.md#environment-variables