首页 > 解决方案 > github操作失败,无法找到文件?

问题描述

github操作不断失败,找不到文件?我能够在我的终端上运行 npm run build 但不能在 github 操作上运行?我错过了什么?

newproject@0.1.0 build /home/runner/work/newproject/newproject/website react-scripts build

创建优化的生产版本...编译失败。

./src/containers/routes/routes.js 在“./src/containers/routes”中找不到文件“../homePage”。

firebase-hosting-merge.yml

name: Build and Deploy
on:
  push:
    branches:
      - master

jobs:
  build:
    name: Build Website 
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repo
        uses: actions/checkout@master
      - name: Install Website Dependencies
        run: cd website && npm install 
      - name: Audit & Fund Website Dependencies
        run: cd website && npm audit fix && npm fund
      - name: Build Website
        run: cd website && CI=false npm run build <<-------------fail at this
  deploy:
    name: Deploy Website to Live
    needs: build
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to Live Domain
        uses: w9jds/firebase-action@master
        with:
          args: deploy --only hosting:dev
        env:
          FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}

标签: javascriptreactjsgithub-actions

解决方案


推荐阅读