From b36e23471b1af7d8a6f49b97badf00ed93fca70c Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Wed, 3 Apr 2019 16:46:33 -0700 Subject: [PATCH] Fix yarn permission denied errors in CircleCI --- .circleci/config.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9120d63c0a..3184417a6f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,9 +11,14 @@ jobs: steps: - checkout - run: echo 'export PATH=$HOME/CIRCLE_PROJECT_REPONAME/node_modules/.bin:$PATH' >> $BASH_ENV + - run: + # HACK(albrow): Without this, yarn commands will sometimes + # fail with a "permission denied" error. + name: Set npm path + command: npm set prefix=/home/circleci/npm && echo 'export PATH=$HOME/circleci/npm/bin:$PATH' >> /home/circleci/.bashrc - run: name: install-yarn - command: sudo npm install --global yarn@1.9.4 + command: npm install --global yarn@1.9.4 - run: name: yarn command: yarn --frozen-lockfile --ignore-engines install || yarn --frozen-lockfile --ignore-engines install