【发布时间】:2021-04-09 17:48:00
【问题描述】:
谁能帮我解决这个问题。 在通过 Github 操作进行应用部署时,我在构建反应应用程序集时遇到此错误。
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?
标签: github-actions