此错误一般发生在:项目构建时不是由hbuilderx生成,但是启动项目用的是hbuilderx

错误原因是由于当前hbuilderx内部使用的node版本和当前项目的node-sass版本不匹配,导致错误

修改hbuilderx的内部编译使用的node版本即可

//1.进入hbuilderx目录
cd /Applications/HBuilderX.app/Contents/HBuilderX/plugins/node  
 
//2.更改node版本,node-12代表node版本改为12的版本,可以切换到你需要的版本,看运行项目时报错提示你使用哪个版本
mv node node-v12

//3.
ln -s /usr/local/bin/node /Applications/HBuilderX.app/Contents/HBuilderX/plugins/node/node

GitHub 加速计划 / no / node-sass
4
0
下载
:rainbow: Node.js bindings to libsass
最近提交(Master分支:4 个月前 )
6081731a Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> 11 个月前
62c0f46c Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> 11 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐