Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Support global Yarn installs and better errors #907

Merged
merged 2 commits into from
May 11, 2017

Conversation

Arcanemagus
Copy link
Member

Add support for global Yarn installations. Apparently one of the few things Yarn did right is that all platforms use the same directory structure under the base directory, unfortunately that meant that on non-Windows platforms specifying the path still got you an unusable setup.

Also fixes the error messages that can be thrown to better reflect the actual causes of the messages.

Fixes #680.
Fixes #780.

Add support for global Yarn installations. Apparently one of the few
things Yarn did right is that all platforms use the same directory
structure under the base directory, unfortunately that meant that on
non-Windows platforms specifying the path still got you an unusable
setup.

Also fixes the error messages that can be thrown to better reflect the
actual causes of the messages.
@Arcanemagus Arcanemagus requested a review from IanVS May 10, 2017 22:01
@Arcanemagus
Copy link
Member Author

Hmmm, the spec failure is due to the fact that all platforms now check the node_modules/eslint path first, so it's finding that path even on the non-Windows platforms.

Do we want to split that folder up, or just remove the lib variant?

Fix the worker helper spec to use the right "global Node path" for the
OS they are running on.
Copy link
Member

@IanVS IanVS left a comment

Choose a reason for hiding this comment

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

Looks good, and seems to work fine on my mac. I don't have a windows machine set up to test, but I'll trust you there and the code looks sane.

@Arcanemagus Arcanemagus merged commit 1db3592 into master May 11, 2017
@Arcanemagus Arcanemagus deleted the arcanemagus/fix-global-yarn branch May 11, 2017 05:02
@Arcanemagus
Copy link
Member Author

Released in v8.2.0 🎉.

@selfagency
Copy link

selfagency commented Jun 8, 2017

I'm on a Mac, I have 8.2.1, I have eslint installed via yarn, and I cannot get it to find eslint even though it's in the $PATH and works fine on the command line. My yarn global prefix is /usr/local and the symlink to the yarn node_modules folder is in the /usr/local/bin folder.

@Arcanemagus
Copy link
Member Author

Arcanemagus commented Jun 8, 2017

@selfagency The only thing that this package uses $PATH for is resolving npm when attempting to get the prefix automatically. Since you are using yarn you will need to specify it manually. Please see #780 for some locations where it might be.

Note that using a global ESLint install is very much discouraged, but supported, you should be using a local instance in your project instead!

If you are still having problems please file a new issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants