在 Windows 上使用 Create React App hate Sass 安装 Node Sass 时遇到错误消息问题,我该怎么办?

Having Issues with Error Messages Installing Node Sass with Create React App hate Sass on Windows, What Should I Do?

感觉我在使用 create react app 安装 sass 时总是遇到问题。有什么具体的windows具体做法吗?我试过了:

npm install --save-dev node-sass

我也卸载重装了

错误信息如下:

npm ERR! invalid: node-sass@6.0.0 /Users/leo/dev/Python/project/frontend/node_modules/node-sass

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/leo/.npm/_logs/2021-05-10T09_05_18_799Z-debug.log

React Complie Log:
Failed to compile.
./src/styles/_global.scss (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-6-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--5-oneOf-6-3!./node_modules/sass-loader/dist/cjs.js??ref--5-oneOf-6-4!./src/styles/_global.scss)
Node Sass version 6.0.0 is incompatible with ^4.0.0 || ^5.0.0.```

感谢@johnsharpe 让我继续前进。

节点 Sass 现在也已弃用,因此您可以尝试使用此命令卸载它

npm uninstall node-sass 并尝试:

npm install --save-dev sass

当我在使用 create react app

在项目上安装 sass 时遇到问题时,这对我有用

https://sass-lang.com/blog/libsass-is-deprecated