【发布时间】:2021-10-23 08:29:35
【问题描述】:
我将 GitHub Action 用于 CI/CD,我从中编写了一些 cypress 测试和 YAML 文件。但是当我推送存储库时出现错误。
name: Cypress Tests
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
jobs:
cypress-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress run
uses: cypress-io/github-action@v2
with:
build: npm run build
start: npm start
失败的错误
./src/App.scss
Node Sass version 6.0.1 is incompatible with ^4.0.0 || ^5.0.0.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reversed-spider-solitaire@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the reversed-spider-solitaire@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output
above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-08-22T20_28_01_743Z-debug.log
Error: The process '/usr/local/bin/npm' failed with exit code 1
我如何解决这个问题。当我在本地运行柏树时,它可以正常工作。
【问题讨论】:
标签: reactjs yaml cypress github-actions