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

Change default value of the preferLocal option to false #314

Merged
merged 1 commit into from
Jun 24, 2019

Conversation

ehmicky
Copy link
Collaborator

@ehmicky ehmicky commented Jun 24, 2019

This changes the default value of the preferLocal option to false.

This option causes several issues for some users: #196, #153.

@ehmicky
Copy link
Collaborator Author

ehmicky commented Jun 24, 2019

CI tests are working now.

@sindresorhus
Copy link
Owner

For posterity, here's my reasoning for doing this change:

  • Most cases don't actually spawn local binaries from node_modules.
    I realized that most of the cases are global binaries and local ones with {cwd: __dirname}.
  • The few times you actually need it, it might be more readable to make it explicit.
  • It causes surprising behavior then because:
    1. Yarn mocks with the PATH too.
    2. Some Node.js installation has a node_modules directory or npm directory that will be used instead of what the user actually wanted. This can happen silently and cause confusion.

So basically, I think we should default to the least surprising behavior.

@sindresorhus sindresorhus changed the title Change default value of preferLocal to false Change default value of the preferLocal option to false Jun 24, 2019
@sindresorhus sindresorhus merged commit eb22ff7 into master Jun 24, 2019
@sindresorhus sindresorhus deleted the feature/change-preferlocal-default branch June 24, 2019 15:38
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