Yarn is a new npm-compatible package manager for Node.js.

Developed at Facebook in collaboration with Exponent, Google, and Tilde, Yarn is a great example of how the community came together to tackle the hard problem that is package management.

Today, we are thrilled to announce that Yarn is now supported on Travis CI.

How does it work?

If your Node.js project has the yarn.lock file in the repository root, we proceed to install Yarn and execute the yarn command instead of the default npm install .

Please note that, at this time, Yarn is not yet pre-installed on our build images. This means that, if yarn.lock does not exist in the expected location, you are responsible for installing Yarn yourself. ( See this GitHub issue comment for a workaround.)

We will make an announcement on our build environment updates page (and the corresponding Atom feed) when Yarn is pre-installed.

Caching with Yarn

We also added a handy directive to cache $HOME/.yarn-cache for your convenience.

To do this, just add:

cache : yarn

and equivalently, along with other caching directives:

cache : yarn : true directories : - node_modules

Further information

For more information, head on over to our Node.js documentation.

As always, if you have questions or spot bugs, get in touch with us via GitHub issues or email.

Happy testing!