You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Apple M2设备SuiteCommerce项目能否用sass替代node-sass?

如何在SuiteCommerce Theme Developer Tool中用sass替代node-sass解决M2 Mac安装问题

核心结论

完全可以用sass(即dart-sass)替代node-sass,这不仅能解决你遇到的M2芯片下的404下载错误,还符合官方长期发展方向——node-sass已被弃用,官方推荐迁移到dart-sass。

具体替换步骤

  • 卸载项目中已有的node-sass:
    npm uninstall node-sass
    
  • 安装sass包:
    npm install sass --save-dev
    
  • 调整项目配置:
    • 检查项目中的构建配置文件(如gulp任务脚本、webpack配置),将所有引用node-sass的模块替换为sass。例如把require('node-sass')改为require('sass');若使用sass-loader,确保其版本与sass兼容(建议sass-loader@13.x搭配sass@1.30.x及以上版本)。
    • 对于SuiteCommerce Theme Developer Tool的内置配置,最新版本已支持自动识别sass,无需修改核心配置,仅需确保项目依赖替换完成即可。

临时绕过原问题的方案(不替换sass的情况)

如果只是想临时解决node-sass的404下载错误,可强制npm以x64架构下载对应包:

npm install node-sass@7.0.0 --target_arch=x64

该命令会让npm请求你提到的正确URL(darwin-x64-83_binding.node),避免ARM架构的错误请求。

内容的提问来源于stack exchange,提问作者Vishal Sangole

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.28 04:56:02