Doesn't work in Bash in Mac Terminal
zhenyulin opened this issue · comments
Do I need to enable ZSH to use this?
The install instructions are incomplete. Not sure if this is the correct way to go about it (I've done this on two Ubuntu machines) but here is my recipe:
- Make sure that yarn has a global prefix by running
yarn config get prefix
- I use the~/.config/yarn/global/bin
for the global path*:yarn config set prefix ~/.config/yarn/global/bin
- Add the bin path to your PATH variable
export PATH="`yarn global bin`:$PATH"
, if you've added it to your .bashrc then also do asource ~/.bashrc
- Clear both tabtab + yarn-completions using
yarn global remove
- Install tabtab:
yarn global add tabtab
- Install yarn-completions:
yarn global add yarn-completions
- Run
source ~/.bashrc
or start a new shell and it should work.
Hope this helps!
- I've seen some suggestions of using
~/.yarn-config
, I don't think it matters as long as step 2 is correct and since~/.config/yarn
is already there I don't see any benefit of adding another yarn directory.
I got completions working following @gforge 's recipe but with one small adjustment, leaving it here in case it's useful to anyone else:
running yarn config set prefix ~/.config/yarn/global/bin
actually caused the script to be linked in ~/.config/yarn/global/bin/bin/yarn-completions for me which caused completion to not work. I ran
yarn config set prefix ~/.config/yarn/global
instead and have completions working now!