corepack icon indicating copy to clipboard operation
corepack copied to clipboard

Cannot run `pnpm dist-tag react` in a pnpm configured project

Open Jack-Works opened this issue 4 years ago • 3 comments

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.

Jack-Works avatar Nov 19 '21 02:11 Jack-Works

That's an interesting one, didn't know pnpm delegates commands to npm 🤔 cc @zkochan

arcanis avatar Nov 19 '21 09:11 arcanis

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?

zkochan avatar Nov 19 '21 21:11 zkochan

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:

image

andreialecu avatar May 16 '22 12:05 andreialecu

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

styfle avatar Mar 04 '24 14:03 styfle