Last active
September 23, 2022 16:11
-
-
Save dennisreimann/c2a6ef58544861f7e13762e06e146dac to your computer and use it in GitHub Desktop.
Travis-CI config for Yarn 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: node_js | |
cache: | |
# Yarn 2 does not store dependencies in node_modules anymore, at least not by default. | |
# If you are using the node-modules plugin, remove the `npm: false` line. | |
npm: false | |
# Yarn 2 caches to the local .yarn directory, not the Travis default `$HOME/.yarn` | |
directories: | |
- ./.yarn/cache | |
before_install: | |
# Upgrade Yarn 1.x: https://classic.yarnpkg.com/en/docs/install | |
- curl -o- -L https://yarnpkg.com/install.sh | bash | |
- export PATH="$HOME/.yarn/bin:$PATH" | |
# Then the local Yarn 2 should be available and get used | |
- yarn -v | |
# Use custom install step as Travis by default uses the --frozen-lockfile flag, which is deprecated | |
install: yarn | |
# rest stays the same, hopefully … |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this. This helped where official yarn or Travis docs didn't have any information regarding this. I encountered additional problems as Travis was having SSL certificate issues fetching yarn from the URL and
yarnrc.yml
file making more issues. I changed thebefore_install
as follows and got it working.