Pesky yarn versions got you down? Automatically and easily manage those versions.
YVM will automatically use the correct yarn version when you run any yarn commands in any folder with a
.yvmrc or any other supported configuration 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.
Installs the latest stable version.
brew install tophat/bar/yvm
Execute the following in your terminal:
curl -fsSL https://raw.githubusercontent.com/tophat/yvm/master/scripts/install.js | node
Or to install a specific version:
curl -fsSL https://raw.githubusercontent.com/tophat/yvm/master/scripts/install.js | INSTALL_VERSION="v0.9.26" node
Navigate to 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, run the following command to configure your shell rc file
To upgrade yvm to the lastest version either install as normal, or run
Run any yarn command and watch it automagically use the correct version of yarn.
Yarn is shimmed to use the default version or the version defined your current directory config file.
To download and install a specific 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:
yvm use <version> yarn --version
NOTE: The above disables yarn shimming until a new shell is loaded.
Control version aliasing:
yvm alias stable # stable → 1.13.0 (1.13.0) yvm alias default stable # default → stable (1.13.0) yvm alias # default → stable (1.13.0) # latest → 1.14.0 (1.14.0) # stable → 1.13.0 (1.13.0) # system → 1.13.0 (1.13.0) yvm alias default '^1.7' # default → ^1.7 (1.14.0)
Show path to version used:
List installed yarn versions:
Full list of available commands:
Yvm defaults to using the
yarn version in your
engines. Otherwise you can create a
.yvmrc file containing the version number of yarn in your project's root directory. Afterwards,
yvm install and
yvm exec will use the version specified in the config file if no version number is supplied to the command.
You can also declare the version using other configuration files