请问有人能帮我解决这个问题吗? 在使用 Github actions 部署应用时,我在构建 React 应用程序时遇到了以下错误。
Run yarn build
yarn run v1.22.5
$ react-scripts build
Creating an optimized production build...
Failed to compile.
EACCES: permission denied, mkdir '/home/runner/work/COVID-19-Tracker-App/COVID-19-Tracker-App/node_modules/.cache'
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.
我的工作流程包括这个,而我在 "构建React应用程序" 部分遇到了这个错误。
# This is a basic workflow to help you get started with Actions
name: React App Deployment
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Install Node.Js
uses: actions/setup-node@v2-beta
with:
node-version: 12
- name: Install Yarn
uses: borales/actions-yarn@v2.0.0
with:
cmd: install # will run `yarn install` command
- name: Build React App
run: yarn build
- name: Install Surge
run: npm install --global surge
- name: Deploy to Surge
run: surge ./build covid-19_tracker_app.surge.sh --token ${{secrets.Surge_Token}}
sudo yarn build
吗? - riQQ