Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools hardcoded to run scripts with npm fail when using corepack-managed npm #496

Open
easrng opened this issue Jun 10, 2024 · 4 comments
Open

Comments

@easrng
Copy link

easrng commented Jun 10, 2024

This worked when using node-managed npm. Ideally I would be able to use npm test and npm run and such but not npm install when a package has packageManager set.

$ npm test
Usage Error: This project is configured to use pnpm
@styfle
Copy link
Member

styfle commented Jun 10, 2024

Try with export COREPACK_ENABLE_STRICT=0

@zoubingwu
Copy link

zoubingwu commented Jul 17, 2024

this flag seems not working, I'm running with node v20.11.0 and corepack v0.10.0.

my issue is some dependency is running a post install script and using npm to run some command:

image

update:

this is resolved by upgrade better-sqlite3 to the latest version. I think this error message is a bit misleading, it's actually the postinstall script that failed because the version of better-sqlite3 we depend on is too old to find a pre-built binary that matches the current node version, and the post-install compilation is failing. Not an issue with npm itself.

@easrng
Copy link
Author

easrng commented Jul 17, 2024

I made a tool that fixes this https://www.npmjs.com/package/npm-run-shim

@mattmess1221
Copy link

@antfu/ni will pick the correct package manager for all the package operations.

npx --package @antfu/ni nr ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants