javascript - 运行 `npm rebuild node-sass` 以在 Github Actions 中下载当前环境的绑定
问题描述
现在我正在 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
,但似乎没有效果。
解决方案
推荐阅读
- node.js - 与 Mongodb Atlas 集群的连接意外关闭
- python - 使用 OpenCV cv2.VideoCapture 在 Python 中从 IP 摄像机进行视频流传输
- c# - 并行启动多个任务,每个任务都有自己的超时时间
- android - 在没有适当锁的情况下转储所有线程
- node.js - 使用 JWT 和本地存储安全访问路由
- java - 改造后。将 JSON 参数添加到每个 post 请求
- r - 将 r 中的月份从意大利语翻译成英语
- javascript - 文件下载 - 如何控制文件名并尊重用户偏好?
- java - 保存时Heroku请求超时代码H12
- ios - 侧栏菜单图标在基于选项卡栏的视图控制器中不可见