You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When yarn installs global packages they usually symlink global node_modules/.bin to /usr/local/bin so if you install a global package that depends on yarn, yarn will override the system installed yarn with the node_module/.bin/yarn one.
I can see this issue starting to get bigger after yarn v2 is released too.
FWIW, I've been struggling with the effects of this for a few months, and finally figured it out enough to find this issue. I'm pretty sure I have a reproducible case, though I can't tell if this is actually yarn being broken or misused:
my system yarn is via homebrew
I have two globally installed packages that depend on this one (apollo and netlify-cli), and this is the only global dependency I have on yarn
if I wipe my global yarn.lock and node_modules and reset all of the symlinks, I can do a yarn add to recreate both with no problems at all
as soon as I do a yarn global upgrade or yarn global upgrade-interactive, the symlinks in /usr/local/bin are overwritten and now point to ~/.config/yarn/global/node_modules/.bin/yarn
this is 100% reproducible, at least in my environment
it's super-annoying
The text was updated successfully, but these errors were encountered:
ahmedelgabri
changed the title
Installing a package that depends on yarn globally will override system yarn
Updating a package that depends on yarn globally will override system yarn
Aug 16, 2019
This is not an issue withyarn
itself, but a current issue faced oclif/plugin-plugins#71 which is a dependency of netlify/cli#269When yarn installs global packages they usually symlink globalnode_modules/.bin
to/usr/local/bin
so if you install a global package that depends onyarn
, yarn will override the system installed yarn with thenode_module/.bin/yarn
one.I can see this issue starting to get bigger after yarn v2 is released too.This might be related to #2627, #3157So is there is any workaround? Also how can this be prevented?Not 100% sure butnpm
might also have this ifnpm
is a dependency of a package tooThanks to @bk3c, he managed to reproduce the issue (see oclif/plugin-plugins#71 (comment)) & I also confirm that this is the case for me too.
The text was updated successfully, but these errors were encountered: