Yarn Version Manager
Pesky yarn versions got you down? Automatically and easilly manage those versions.
YVM will automatically use the correct yarn version when you run any yarn commands in any folder with a .yvmrc
file. Otherwise, it will use you a globally set version of yarn.
Manually managing different yarn versions across projects is a pain. This fixes that.
Node: >=8.0.0
Execute the following in your terminal:
curl -fsSL https://raw.githubusercontent.com/tophat/yvm/master/scripts/install.sh | bash
Or to install a specific version:
curl -fsSL https://raw.githubusercontent.com/tophat/yvm/master/scripts/install.sh | INSTALL_VERSION="v0.9.26" bash
Navigate to https://github.com/tophat/yvm/releases and download the yvm.zip
file for the latest release to your home directory.
Next, unzip that file to the .yvm dir in your home directory and make extracted yvm.sh executable
unzip yvm.zip -d $HOME/.yvm
chmod a+x $HOME/.yvm/yvm.sh
Finally, add the following lines to your $HOME/.zshrc
or $HOME/.bashrc
, depending on the shell you use
export YVM_DIR=/home/joe_user/.yvm
[ -r $YVM_DIR/yvm.sh ] && source $YVM_DIR/yvm.sh
To upgrade yvm to the lastes version either install as normal, or run
yvm update-self
Run any yarn command and watch it magically use the correct version of yarn
To download and install a version of yarn, run:
yvm install <version>
To get the latest version of Yarn, run:
yvm install --latest
Execute an arbitrary command using a specific version of yarn:
yvm exec <version> <command>
Switch the current yarn versions, using:
yvm use <version>
yarn --version
List Versions
yvm list
Check Current Version
yvm which
Full list of available commands
yvm help
You can create a .yvmrc
file containing the version number of yarn in your project's root directory. Afterwards, yvm use
, yvm install
and yvm exec
will use the version specified in the .yvmrc
file if no version number is supplied to the command.
You can also declare the version using other configuration files
A full list of commands is on the api reference page
Have questions? List of common questions and answers
To remove yvm simply execute
rm -rf $YVM_DIR
Next, edit $HOME/.bashrc
and $HOME/.zshrc
and remove those lines:
export YVM_DIR=/home/joe_user/.yvm
[ -r $YVM_DIR/yvm.sh ] && source $YVM_DIR/yvm.sh
In case you had older version of yvm installed, there could also be a line like
source /home/joe_user/.yvm/yvm.sh
or those lines could be in $HOME/.bash_profile
instead of $HOME/.bashrc
.
We welcome contributions from the community, Top Hatters and non-Top Hatters alike. Here are some guidelines to help you get started!
- Ensure the problem you are solving is an issue or you've created one
- Clone the repo
- We use make.
make help
will show you a list of development commands make install-watch
will install yvm on your shell, update when you make changes, and automatically source yvm.sh. Make sure to only run this in the root yvm directory. It will fail elsewhere.make test
andmake lint
are also commonly helpful
Make sure all changes are well documented. Our documentation can be found inside the docs
section of this repo. Be sure to read it carefully and make modifications wherever necessary.
You can also access the documentation on our website
Please make sure to look over our Code of Conduct as well!
make install
yvm <your-command-here>
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Thanks to Carol Skelly for donating the github organization!