Yarn is not installedSee original GitHub issue
We are using a self-hosted runner and using this action to setup-node and install yarn.
I know on github-hosted runners, yarn is already pre-installed but it would be good if yarn was installed by this action for those of us using self-hosted.
Running setup-node with the following workflow and it works
with: node-version: 12.13.0 always-auth: true registry-url: https://registry.npmjs.org /usr/bin/tar xz --warning=no-unknown-keyword -C /actions-runner/_work/_temp/febce1c0-314e-4a14-9a65-5bde8a990b71 -f /actions-runner/_work/_temp/d4bf33ab-571e-458e-9495-bd6c5b994814 /actions-runner/_work/_tool/node/12.13.0/x64/bin/node --version v12.13.0 /actions-runner/_work/_tool/node/12.13.0/x64/bin/npm --version 6.12.0
Note that node and npm are installed.
A later step in the workflow then attempts to run yarn:
Run yarn install --ignore-scripts --frozen-lockfile /actions-runner/_work/_temp/58e53b82-f9ae-4c68-9cec-75f75831208b.sh: line 1: yarn: command not found ##[error]Process completed with exit code 127.
This of course works on github hosted runners just fine, but since I just migrated to an EC2 instance that doesn’t have yarn installed, I am now having issues.
- Created 3 years ago
Top GitHub Comments
Workaround is to install yarn yourself using npm (after running this action)
- name: Install Yarn run: npm install -g yarn
and later can uninstall it -
- name: Uninstall Yarn if: always() run: npm uninstall -g yarn
While this works, I find it rather hacky. It would be good for this action to not need to rely on github’s instances to have yarn package installed.
I wanted to add the documentation acts as if
yarn is a given, since it has sections on usage with yarn
Publish to npmjs and GPR with yarn:. Perhaps some clarification in that section that if you’re on self-hosted runners you will need to install yarn yourself via
npm install -g yarn and uninstall it at the end of your job with
npm uninstall -g yarn
Note that if you use
with: cache: yarn this action will fail if you don’t have yarn pre-installed… But since you need node to install yarn… you can’t get out of this without running this action twice or using other actions.