vue启动报错 Run `npm rebuild node-sass` to download the binding for your current environment
node-sass
:rainbow: Node.js bindings to libsass
项目地址:https://gitcode.com/gh_mirrors/no/node-sass
免费下载资源
·
vue启动项目报错 Run npm rebuild node-sass
to download the binding for your current environment
npm rebuild node-sass后报关于python的错误
安装python
去官网http://www.python.org
选择适合你的版本
安装时注意选勾选 add Python 3.10 to PATH
安装python后依然报sass的错误 发现还是版本问题
使用dart-sass(亲测好用):
(1)卸载node-sass 和 sass-loader
npm uninstall node-sass sass-loader
(2)安装
npm install sass-loader@^10 sass -D
重启项目发现报几处语法错误
这里需要将项目中的 /deep/ 替换为 ::v-deep 即可
总结
由于nodejs版本问题,导致处理老项目时node-sass出现报错,为了更加简便所以替换为dart-sass,二者部分语法不同,如/deep/转换为 ::v-deep。
如果不想使用dart-sass,解决办法(安装sass 基本环境最佳匹配 “nodejs 14.x” “sass-loader@7.3.1” “node-sass@4.14.1”):
(1)将nodejs 版本为改回 14.x,不要使用 16.x 等版本;
(2)卸载node-sass 和 sass-loader
npm uninstall node-sass sass-loader
(3)安装匹配版本:
npm install sass-loader@7.3.1 node-sass@4.14.1 --save-dev
GitHub 加速计划 / no / node-sass
8.5 K
1.33 K
下载
:rainbow: Node.js bindings to libsass
最近提交(Master分支:2 个月前 )
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> 9 个月前
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> 9 个月前
更多推荐
已为社区贡献2条内容
所有评论(0)