Skip to content

Instantly share code, notes, and snippets.

@djuber
Created February 8, 2021 23:44
Show Gist options
  • Save djuber/09f4d2601faeeb7e1ee21e0e72b596cf to your computer and use it in GitHub Desktop.
Save djuber/09f4d2601faeeb7e1ee21e0e72b596cf to your computer and use it in GitHub Desktop.
steps to pull node and yarn, then install them during circle container prep
# step should have NODE_VERSION and YARN_VERSION environment variables declared
- run:
name: Download NodeJS things
command: |
mkdir -p nodejs-downloads/
cd nodejs-downloads/
[ -f node-v${NODE_VERSION}-linux-x64.tar.xz ] || curl -O https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz
[ -f yarn-v${YARN_VERSION}.tar.gz ] || curl -O -L https://yarnpkg.com/downloads/${YARN_VERSION}/yarn-v${YARN_VERSION}.tar.gz
- run:
name: Install NodeJS things
command: |
cd nodejs-downloads/
sudo tar -xJ -C /usr/local --strip-components=1 --no-same-owner -f node-v${NODE_VERSION}-linux-x64.tar.xz
sudo ln -s /usr/local/bin/node /usr/local/bin/nodejs
sudo mkdir -p /opt/yarn
sudo tar -xz -C /opt/yarn --strip-components=1 -f yarn-v${YARN_VERSION}.tar.gz
sudo ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn
sudo ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment