gpt4 book ai didi

npm - 构建时 GitHub 操作崩溃

转载 作者:行者123 更新时间:2023-12-03 22:00:27 27 4
gpt4 key购买 nike

我对 DevOps 的世界真的很陌生,我想把我的脚趾浸入水中。这就是为什么我一直在尝试设置一个简单的 GitHub Action,当我推送到 master 时,我的站点会自动部署到 Firebase,但在构建阶段出现问题:

Run npm run build
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/runner/work/ChezMout/ChezMout/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/runner/work/ChezMout/ChezMout/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2020-01-12T12_04_27_341Z-debug.log
##[error]Process completed with exit code 254.

这是我的基本工作流程:
name: Build and Deploy
on:
push:
branches:
- master

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to Firebase
uses: w9jds/firebase-action@v1.1.0
with:
args: deploy
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
PROJECT_ID: chez-mout

有什么我在做的明显错误吗?

最佳答案

npm install 无法找到 package.json 文件。请确保它存在于您的存储库的根文件夹中。 (并且受版本控制且有效)。

关于npm - 构建时 GitHub 操作崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59703813/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com