I tried some possible CLI commands but none seem to actually update the packages installed with yarn global add
.
yarn global upgrade
& yarn upgrade global
both don't work correctly. Is there a way of upgrading global packages?
As webjay says, you simply:
yarn global upgrade
in yarn
version 1.2.1 onwards.
For earlier versions:
(cd ~/.config/yarn/global && yarn upgrade)
Sadly, there is currently no yarn global check
.
You can run yarn global add --force
to reinstall all packages.
To check
global packages, you can treat ~/.config/yarn/global/
like a local package, since:
~/.config/yarn/global/package.json
has dependencies for all global packages~/.config/yarn/global/node_modules
contains all the global packages. Check all global packages, and reinstall only if an error is found:
$ (cd ~/.config/yarn/global && yarn check || yarn install --force)