问题描述
Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1
at module.exports (/Users/hhag/Desktop/test_gulp/node_modules/node-sass/lib/binding.js:13:13)
at Object.<anonymous> (/Users/hhag/Desktop/test_gulp/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Module.require (node:internal/modules/cjs/loader:1013:19)
at require (node:internal/modules/cjs/helpers:93:18)
at Object.<anonymous> (/Users/hhag/Desktop/test_gulp/node_modules/gulp-sass/index.js:166:21)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
当我开始使用 gulp 时出现此错误。是否有将 gulp-sass 与 apple m1 一起使用的解决方案?谢谢
解决方法
我在 M1 上安装 node-sass
时也遇到了问题,最终利用 LibSass 弃用通知中的建议将其替换为 sass
。
https://sass-lang.com/blog/libsass-is-deprecated
替换完全顺利,它在 M1 上工作,我在本地或 CI 上没有注意到任何性能影响。
,我想,您使用的是 M1 Mac。并且 node-sass 目前本身不支持它。请参阅:https://github.com/sass/node-sass/issues/3033
现在您可以设置目标拱门以通过 Rosetta 运行它:
rm -rf node_modules
npm install --target_arch=x64