NodeJS Angular 误差:节点Sass版本6.0.0与^4.0.0不兼容,Angular [重复]

yi0zb3m4  于 2022-12-22  发布在  Node.js
关注(0)|答案(3)|浏览(143)
    • 此问题在此处已有答案**:

Node Sass version 6.0.0 is incompatible with ^4.0.0 || ^5.0.0 in React.js(7个答案)
去年关闭了。
我安装NPM包,启动NPM后,我收到node sass错误,如下所示:

    • 引发错误:**
ERROR in ./node_modules/slick-carousel/slick/slick.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./node_modules/slick-carousel/slick/slick.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Node Sass version 6.0.0 is incompatible with ^4.0.0.
    at getRenderFuncFromSassImpl (D:\Templets\angular ecommerce side\embryoangularadmin\embryoangularadmin\Embryo-Main\embryo1\embryo\node_modules\sass-loader\lib\loader.js:108:19)
    at Object.sassLoader (D:\Templets\angular ecommerce side\embryoangularadmin\embryoangularadmin\Embryo-Main\embryo1\embryo\node_modules\sass-loader\lib\loader.js:46:20)
ERROR in ./node_modules/slick-carousel/slick/slick-theme.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./node_modules/slick-carousel/slick/slick-theme.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Node Sass version 6.0.0 is incompatible with ^4.0.0.
    at getRenderFuncFromSassImpl (D:\Templets\angular ecommerce side\embryoangularadmin\embryoangularadmin\Embryo-Main\embryo1\embryo\node_modules\sass-loader\lib\loader.js:108:19)
    at Object.sassLoader (D:\Templets\angular ecommerce side\embryoangularadmin\embryoangularadmin\Embryo-Main\embryo1\embryo\node_modules\sass-loader\lib\loader.js:46:20)
ERROR in ./src/assets/scss/style.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/assets/scss/style.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Node Sass version 6.0.0 is incompatible with ^4.0.0.
    at getRenderFuncFromSassImpl (D:\Templets\angular ecommerce side\embryoangularadmin\embryoangularadmin\Embryo-Main\embryo1\embryo\node_modules\sass-loader\lib\loader.js:108:19)
    at Object.sassLoader (D:\Templets\angular ecommerce side\embryoangularadmin\embryoangularadmin\Embryo-Main\embryo1\embryo\node_modules\sass-loader\lib\loader.js:46:20)
5fjcxozz

5fjcxozz1#

这只是版本与节点不匹配。

要安装工作的node-sass版本,可以使用

npm uninstall node-sass
npm install node-sass@4.14.0

根据您正在使用的节点版本,根据下表选择您的版本号,您可以通过node --version检查

这对我很有效

rkkpypqq

rkkpypqq2#

npm =〉

npm uninstall node-sass

npm install node-sass@4.14.1

带Yarn=〉

yarn remove node-sass

yarn remove node-sass@4.14.1

npm卸载节点sass
npm安装节点sass@4.14.1

这对我很有效

kulphzqa

kulphzqa3#

使用以下代码

npm uninstall node-sass
 npm install node-sass@4.14.1

这对我很有效

相关问题