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: ignore packageLockOnly in npx/exec #4649

Closed
wants to merge 1 commit into from

Conversation

fritzy
Copy link
Contributor

@fritzy fritzy commented Mar 31, 2022

When npx/exec is ran as a script, packageLock and packageLockOnly config items can be passed to npx, which may prevent the bin packages from being installed.

This updated libnpmexec to clear those config items.

Closes #4595

@fritzy fritzy requested a review from a team as a code owner March 31, 2022 05:39
@npm-robot
Copy link
Contributor

no statistically significant performance changes detected

timing results
app-large clean lock-only cache-only cache-only
peer-deps
modules-only no-lock no-cache no-modules no-clean no-clean
audit
npm@8 65.588 ±7.49 33.612 ±0.20 19.891 ±0.50 22.415 ±1.04 3.266 ±0.01 3.326 ±0.03 2.766 ±0.11 12.899 ±0.04 2.664 ±0.01 3.714 ±0.05
#4649 60.416 ±2.38 34.129 ±0.50 20.180 ±0.11 23.044 ±0.75 3.418 ±0.03 3.416 ±0.06 2.749 ±0.09 13.143 ±0.01 2.734 ±0.06 3.925 ±0.01
app-medium clean lock-only cache-only cache-only
peer-deps
modules-only no-lock no-cache no-modules no-clean no-clean
audit
npm@8 41.808 ±0.40 26.041 ±0.12 14.806 ±0.00 15.991 ±0.11 3.094 ±0.00 3.039 ±0.00 2.747 ±0.12 9.650 ±0.27 2.523 ±0.01 3.537 ±0.01
#4649 41.438 ±0.47 26.555 ±0.15 15.189 ±0.38 16.289 ±0.14 3.144 ±0.06 3.080 ±0.02 2.803 ±0.08 9.815 ±0.08 2.603 ±0.01 3.518 ±0.13

@@ -40,6 +40,8 @@ const exec = async (opts) => {
yes = undefined,
...flatOptions
} = opts
delete flatOptions.packageLock
delete flatOptions.packageLockOnly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't delete things from flatOptions since we pass it everywhere and it could have unintended side effects. I think creating a new object and omitting these specifically is a better option.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should happen in the command itself too.

@nlf
Copy link
Contributor

nlf commented May 3, 2022

replaced by #4843

@nlf nlf closed this May 3, 2022
@lukekarrys lukekarrys deleted the fritzy/exec-ignore-lock branch June 29, 2022 23:05
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.

[BUG] preinstall script with npx does not work with --package-lock-only
5 participants