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

fix: do not run node-gyp rebuild if preinstall lifecycle script is present #7206

Merged
merged 2 commits into from
Oct 15, 2023

Conversation

andclt
Copy link
Contributor

@andclt andclt commented Oct 15, 2023

According to npm documentation:

If there is a binding.gyp file in the root of your package and you haven't defined your own install or preinstall scripts, npm will default the install command to compile using node-gyp via node-gyp rebuild

However, in the case of pnpm, this check was only performed if an install script was defined, resulting in a discrepancy between the behavior of npm and pnpm. You can refer to this GitHub issue for more information: aws/aws-lambda-nodejs-runtime-interface-client#78.

This pull request modifies pnpm to execute node-gyp rebuild only when neither the preinstall nor the install scripts are defined.

@andclt andclt requested a review from zkochan as a code owner October 15, 2023 18:24
@welcome
Copy link

welcome bot commented Oct 15, 2023

💖 Thanks for opening this pull request! 💖
Please be patient and we will get back to you as soon as we can.

@zkochan
Copy link
Member

zkochan commented Oct 15, 2023

Thanks for tracking down the issue.

@zkochan zkochan merged commit 84f81c9 into pnpm:main Oct 15, 2023
7 checks passed
@welcome
Copy link

welcome bot commented Oct 15, 2023

Congrats on merging your first pull request! 🎉🎉🎉

@andclt andclt deleted the gyp-preinstall branch October 15, 2023 20:39
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

Successfully merging this pull request may close these issues.

None yet

2 participants