npm-run-build遇到Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 14.x

今天 npm run build-prod 打包项目的时候遇到如下报错信息:

1
Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js

百度了一些解决方案都没法解决问题,后来在 Stack Overflow 上看到了一种解决方案,地址:https://stackoverflow.com/questions/64612707/node-sass-does-not-yet-support-your-current-environment-windows-64-bit-with-uns

  1. install / downgrade node.js to a stable version (LTS) like 14.15.0
  2. install the compatible node-sass version via npm install node-sass@4.14.0; you can find the list here, or even install gulp-sasswith npm i gulp-sass --save-dev.