'facing a permission issue when build react app in GitHub actions
This is my GitHub Actions script to build a react project:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- name: Install yarn
uses: borales/[email protected]
- name: Build React App
run: |
sudo rm -rf node_modules
yarn
umi build
when I run this project in GitHub actions, shows error:
warning "umi-serve > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "umi-serve > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning Workspaces can only be enabled in private projects.
warning Workspaces can only be enabled in private projects.
[5/5] Building fresh packages...
error An unexpected error occurred: "EACCES: permission denied, open '/home/runner/work/admin/admin/yarn.lock'".
info If you think this is a bug, please open a bug report with the information provided in "/home/runner/work/admin/admin/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: Process completed with exit code 1.
why could not access the project yarn.lock when using yarn command? why facing the permission issue in GitHub Actions? what should I do to fix this problem?
Solution 1:[1]
I also facing the similar issue with it, you should tried to use actions/setup-node like this to fix it:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- run: npm install yarn -g
- name: Build React App
run: |
yarn
yarn global add umi
umi build
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dolphin |
