我在Github上配置了一个工作流,在运行npm install时会出现以下错误:
npm WARN saveError ENOENT: no such file or directory, open '/home/runner/work/project/project/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/runner/work/project/project/package.json'
npm WARN restaurateur No description
npm WARN restaurateur No repository field.
npm WARN restaurateur No README data
npm WARN restaurateur No license field.正如我所理解的,这个错误意味着npm install命令找不到package.json文件,但是,我检查了它,并且package.json在我的项目中是可见的。
我该如何解决这个问题?
这是我创建的.yml文件
name: project-folder
on:
push:
paths: project-folder**
branches: [main]
pull_request:
paths: project-folder/**
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Run the tests
run: npm test
- name: Build
run: npm run build发布于 2022-02-17 05:52:33
运行npm命令创建package.json
https://stackoverflow.com/questions/66789302
复制相似问题