gpt4 book ai didi

reactjs - Cypress Github 操作失败

转载 作者:行者123 更新时间:2023-12-05 04:46:19 25 4
gpt4 key购买 nike

我将 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

我如何解决这个问题。当我在本地运行 cypress 时,它工作正常。

最佳答案

您需要先设置 Node 版本。

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 15

关于reactjs - Cypress Github 操作失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68884974/

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