运行'npm rebuild node sass',在github操作中下载当前环境的绑定

6l7fqoea  于 2021-09-29  发布在  Java
关注(0)|答案(0)|浏览(293)

现在我正在github actions中构建一个节点项目,这是我的ci脚本:

name: cernitor-ci

on:
  push:
    branches: [ main ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: 16.5.0
      - name: Install yarn
        uses: borales/actions-yarn@v2.3.0
        with: 
         cmd: install
      - name: Build React App
        run: |
         sudo yarn 
         sudo yarn add --check-files node-sass
         sudo npm rebuild node-sass
         yarn build

遇到 Build React App 块,显示此错误:

yarn run v1.22.10
$ CI=false && react-app-rewired build
Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Failed to compile.

./src/style/base.scss
Error: Missing binding /home/runner/work/Cernitor/Cernitor/node_modules/node-sass/vendor/linux-x64-93/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 16.x

Found bindings for the following environments:
  - Linux 64-bit with Node.js 14.x
  - Linux/musl 64-bit with Node.js 14.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.

我该怎么做才能修好它?我已经尝试将节点升级到最新版本。重建 node-sass ,但似乎没有效果。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题