运行 npm run dev 时如何解决此节点 sass 不兼容版本错误?

发布于 01-15 01:18 字数 584 浏览 3 评论 0原文

每当我运行 npm run dev 时,我都会收到此错误:

错误:Node Sass 版本 7.0.1 与 ^4.0.0 不兼容。

基于兼容性列表 (https://github.com/sass/node-sass) 我尝试过设置 node -sass6.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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眉目亦如画i2025-01-22 01:18:18

查看 node-sass 包后,它似乎已被弃用。您应该使用 sass 模块而不是 node-sass

npm uninstall node-sass
npm install sass

如果您更喜欢使用 node-sass,请查看 https://www.npmjs.com/package/node-sass 你会发现你需要的node16.x的tyhat节点 sass 6.x

After taking a look at node-sass package it appear to be deprecated. You should use sass module instead of node-sass

npm uninstall node-sass
npm install 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 need node-sass 6.x

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文