运行 npm run dev 时如何解决此节点 sass 不兼容版本错误?
每当我运行 npm run dev
时,我都会收到此错误:
错误:Node Sass 版本 7.0.1 与 ^4.0.0 不兼容。
基于兼容性列表 (https://github.com/sass/node-sass) 我尝试过设置 node -sass
到 6.0.0
它仍然给我同样的错误
,我已经查找了所有解决此问题的方法,但无济于事,我确实尝试了阳光下的所有方法。
任何建议将不胜感激
信息: 节点版本 - 16.14.0
npm 版本 - 8.3.1
在 package.json
中:
".devDependencies": {
"sass-loader": "^7.3.1"
}
"dependencies": {
"node-sass": "^7.0.0"
}
whenever I run npm run dev
I get this error:
Error: Node Sass version 7.0.1 is incompatible with ^4.0.0.
Based on the compatibility list (https://github.com/sass/node-sass) I've tried setting node-sass
to 6.0.0
it still gives me the same error
I've looked up all the ways to solve this but to no avail, I've literally tried everything under the sun.
Any suggestion would be greatly appreciated
info:
node version - 16.14.0
npm version - 8.3.1
in package.json
:
".devDependencies": {
"sass-loader": "^7.3.1"
}
"dependencies": {
"node-sass": "^7.0.0"
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

查看
node-sass
包后,它似乎已被弃用。您应该使用sass
模块而不是node-sass
如果您更喜欢使用
node-sass
,请查看 https://www.npmjs.com/package/node-sass 你会发现你需要的node16.x的tyhat节点 sass 6.xAfter taking a look at
node-sass
package it appear to be deprecated. You should usesass
module instead ofnode-sass
If you prefer using
node-sass
take a look at https://www.npmjs.com/package/node-sass you will find there tyhat for node16.x you neednode-sass
6.x