node node-sass sass-loader版本对应问题,对于npm编译大家经常遇到版本不对应导致编译报错的问题
node-sass
:rainbow: Node.js bindings to libsass
项目地址:https://gitcode.com/gh_mirrors/no/node-sass
免费下载资源
·
问题对应项目
gitee源代码地址: https://gitee.com/qingplus
1.查看本地node版本
cmd 进入控制台
node -v
具体对应版本如下图
NodeJS | Supported node-sass version | Node Module |
---|---|---|
Node 20 | 9.0+ | 115 |
Node 19 | 8.0+ | 111 |
Node 18 | 8.0+ | 108 |
Node 17 | 7.0+, <8.0 | 102 |
Node 16 | 6.0+ | 93 |
Node 15 | 5.0+, <7.0 | 88 |
Node 14 | 4.14+, <9.0 | 83 |
Node 13 | 4.13+, <5.0 | 79 |
Node 12 | 4.12+, <8.0 | 72 |
Node 11 | 4.10+, <5.0 | 67 |
Node 10 | 4.9+, <6.0 | 64 |
Node 8 | 4.5.3+, <5.0 | 57 |
Node <8 | <5.0 | <57 |
具体对应链接地址:
https://www.npmjs.com/package/node-sass
2.查看项目中package中node-sass和sass-loader是否对应node版本
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/799e78ab56b541678187826398f1016b.png
3.不对应应修改成对应版本号
sass-loader 4.1.1,node-sass 4.3.0
sass-loader 7.0.3,node-sass 4.7.2
sass-loader 7.3.1,node-sass 4.7.2
sass-loader 7.3.1,node-sass 4.14.1
sass-loader 10.0.1,node-sass 6.0.1
4.如果node是最新版本,则可以直接使用以下命令安装即可
npm install sass-loader node-sass --save-dev
cnpm install sass-loader node-sass --save-dev
5.如果node不是最新版本,则需要安装对应的版本号才行
npm install sass-loader@版本号 node-sass@版本号 --save-dev //安装对应的版本
cnpm install sass-loader@版本号 node-sass@版本号 --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> 8 个月前
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> 8 个月前
更多推荐
已为社区贡献6条内容
所有评论(0)