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

Corepack + non-npm package manager compatibility #893

Closed
nathanhammond opened this issue Oct 24, 2022 · 0 comments · Fixed by #894
Closed

Corepack + non-npm package manager compatibility #893

nathanhammond opened this issue Oct 24, 2022 · 0 comments · Fixed by #894

Comments

@nathanhammond
Copy link
Contributor

Hey y'all! Because of the way the install script is configured for better-sqlite3 it doesn't always play nicely with corepack when a consumer is using a non-npm package manager.

Corepack inspects the package.json of an end-user's project, and, if packageManager is set, restricts invocation of other package managers. This works in most cases but fails when a package that project wants to install has a lifecycle script that hard-codes a package manager. In this case, npm run build-release.

There are multiple workarounds to this problem but they all have tradeoffs.

I'm hoping you'd be willing to consider making a change that adjusts the install script in your package.json. There are a number of options:

  • "install": "prebuild-install || node-gyp rebuild --release"
  • "install": "prebuild-install || npm run build-release || yarn run build-release || pnpm run build-release"
  • "install": "prebuild-install || COREPACK_ENABLE_STRICT=0 npm run build-release"

What do you think?

mceachen pushed a commit that referenced this issue Oct 27, 2022
This ensures compatibility with all package manager installation choices.

Closes #893.
m4heshd added a commit to m4heshd/better-sqlite3-multiple-ciphers that referenced this issue Nov 1, 2022
This ensures compatibility with all package manager installation choices.

Closes WiseLibs/better-sqlite3#893.

Co-authored-by: Nathan Hammond <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant