升级node.js版本之后,node-sass 启动vue项目报错: PostCSS received undefined instead of CSS string
node-sass
:rainbow: Node.js bindings to libsass
项目地址:https://gitcode.com/gh_mirrors/no/node-sass
免费下载资源
·
解决 Syntax Error: Error: PostCSS received undefined instead of CSS string
解决方法
卸载当前版本的node-sass和sass-loader,因为版本和当前的不兼容,安装对应版本的包即可。
#卸载node-sas和sass-loader
npm uninstall node-sass
npm uninstall sass-loader
安装其他版本
#安装node-sas和sass-loader
npm install node-sass@4.14.1
npm install sass-loader@8.0.0
如果npm安装不成功的话可以试一下cnpm
#安装淘宝镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
#检查是否安装成功
cnpm -v
解决后可以尝试npm run serve
npm run server
node与node-sass对照版本
链接: https://www.npmjs.com/package/node-sass.
NodeJS | Supported node-sass version | Node Module |
---|---|---|
Node 17 | 7.0+ | 102 |
Node 16 | 6.0+ | 93 |
Node 15 | 5.0+, <7.0 | 88 |
Node 14 | 4.14+ | 83 |
Node 13 | 4.13+, <5.0 | 79 |
Node 12 | 4.12+ | 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 |
GitHub 加速计划 / no / node-sass
3
0
下载
:rainbow: Node.js bindings to libsass
最近提交(Master分支:3 个月前 )
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> 10 个月前
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> 10 个月前
更多推荐
已为社区贡献4条内容
所有评论(0)