Skip to content

Local binaries should have higher priority than global binaries #10

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

Merged
merged 1 commit into from
Dec 22, 2019
Merged

Local binaries should have higher priority than global binaries #10

merged 1 commit into from
Dec 22, 2019

Conversation

ehmicky
Copy link
Contributor

@ehmicky ehmicky commented Dec 22, 2019

Currently npm-run-path makes global binaries have higher priority than local binaries, which is incorrect.

This bug was introduced by me in #8 (I am very sorry about this! :-/ ). The reason behind #8 was for npm-run-path to enforce that the current Node.js version is re-used in child processes, including when a user installs node locally (e.g. through npx node).

However, as a side effect, #8 also inverted the priority between global binaries and local binaries since node is installed in the same directory as binaries. This means Execa preferLocal option is no longer working (see sindresorhus/execa#404).

This PR reverts to the old behavior.

@sindresorhus sindresorhus merged commit 52c8542 into sindresorhus:master Dec 22, 2019
@ehmicky ehmicky deleted the fix/exec-path-order branch December 23, 2019 09:30
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.

2 participants