-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Yarn points to global binaries in a dynamic folder. #1389
Comments
@adamsiwiec Based on how/why NPM does this currently, imo this shouldn't necessarily be added to yarn. Currently, NPM does not put global binaries in a static folder, or rather, a folder that stays the same regardless of node version. This is, as far as I can tell, by design – if you changed the node version and the installed global binary stayed the same, but the installed global binary was incompatible with the new node version (for example, a global binary that only works with 0.10/0.12 and you change your node version to 6.0), the global binary could cease to work, and would likely throw silent or unhelpful errors. tl;dr the reason the global binaries are linked to a dynamic folder is to ensure node version compatibility and is by design. |
I think the big issue here is when you install something with the global scope, and that binary can't be available globally because that PATH isn't automatically exported. The binary will be added to the folder "/usr/local/Cellar/node/6.9.1/bin/" and to call it will be required add that folder manually to the PATH var or call it directly with the path:
Obviously are something wrong there, because is supposed that |
I added the following line to my
Note: I installed both node and yarn via homebrew. EDIT: New solution for yarn nightlies posted below. |
@cwonrails seems not to work anymore with new versions since ".yarn-config" not exists see #1321 |
I'm seeing it still working with |
suggestion: yarn should install global packages in a directory that most people already have in its path, like npm does. |
@marcosfede +1 |
New two-step solution for those running the yarn nightlies: (1) I have a
(2) After running the script, I make sure the following two lines are located at the bottom of my
All global binaries are now available! (currently running version Extra steps for testing the new install I then run
Here's the output from
Hope this proves helpful! |
Duplicate: #2064 |
@bestander we can close this because it is a duplicated. @OmgImAlexis you are awesome O.o |
Do you want to request a feature or report a bug?
Bug/Feature
What is the current behavior?
Yarn points to a dynamic directory for global binaries (e.g
/usr/local/Cellar/node/6.9.1/bin
and6.9.1
changes frequently).If the current behavior is a bug, please provide the steps to reproduce.
Installing node and yarn with Homebrew results in this inability/redundancy to access/install binaries.
What is the expected behavior?
Yarn should place global binaries in a static folder (e.g
~/.yarn/bin
), which is most likely already in people$PATH
variable, and it already exists.Please mention your node.js, yarn and operating system version.
OS: MacOS 10.12.1 Beta
The text was updated successfully, but these errors were encountered: