only-allow icon indicating copy to clipboard operation
only-allow copied to clipboard

I have set 'npx only allow pnpm', but it only takes effect for Yarn

Open LiuCaptain opened this issue 1 year ago • 5 comments

When I set 'npx only allow pnpm' and use Yarn to install dependencies, it is not allowed, which is normal; But when I use NPM, it can still install dependencies normally

image

LiuCaptain avatar Oct 23 '23 04:10 LiuCaptain

👀

ivomarsan avatar Nov 13 '23 22:11 ivomarsan

Related issue: https://github.com/npm/cli/issues/2660

This could be due to a npm problem that "preinstall" script gets run after dependencies installation.

The npx only-allow pnpm command should be executed before dependencies installation to properly abort the process when using other package managers, otherwise it could be meaningless.

Since the upstream issue could be hard to get fixed, I took another approach to achieve that and created this package just-pnpm to force project contributors to use pnpm.

Hope this helps! :)

prinsss avatar Dec 06 '23 07:12 prinsss

with [email protected] neither solution works for me. Not sure if it's because I'm using husky in a prepare script or not.

intellix avatar Dec 15 '23 11:12 intellix

with [email protected] neither solution works for me. Not sure if it's because I'm using husky in a prepare script or not.

Same - and I have no prepare script :(

kepi avatar Dec 21 '23 14:12 kepi

same issue with npm 10

menasheh avatar Jan 03 '24 21:01 menasheh