【发布时间】:2021-07-04 01:45:33
【问题描述】:
我在尝试运行 "npm start" 或 "ng serve" 时收到此错误。我正在使用 node 版本 v11.15.0,npm 版本 6.7.0。
ERROR in ./src/app/shared/components/pop-up/pop-up.component.scss
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
@extend button.mat-button.default-button;
^
Compound selectors may no longer be extended.
Consider `@extend button, .mat-button, .default-button` instead.
╷
116 │ @extend button.mat-button.default-button;
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
stdin 116:29 root stylesheet
in xyz/src/app/shared/components/pop-up/pop-up.component.scss (line 116, column 29)
ERROR in ./src/app/core/authentication/login/login.component.scss
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
@extend button.mat-button.default-button;
^
Compound selectors may no longer be extended.
Consider `@extend button, .mat-button, .default-button` instead.
╷
59 │ @extend button.mat-button.default-button;
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
stdin 59:21 root stylesheet
in xyz/src/app/core/authentication/login/login.component.scss (line 59, column 21)
ERROR in ./src/app/modules/abc/components/scan-input/scan-input.component.scss
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
:host /deep/ .mat-radio-label {
^
Expected selector.
╷
43 │ :host /deep/ .mat-radio-label{
│ ^
╵
stdin 43:7 root stylesheet
in xyz/src/app/modules/abc/components/scan-input/scan-input.component.scss (line 43, column 7)
ℹ 「wdm」: Failed to compile.
我也尝试了一些解决方案,例如 -
npm rebuild node-sass
npm install --save-dev --unsafe-perm node-sass
npm install node-sass
但不幸的是,没有一个对我有利。我需要帮助来解决这个问题。
【问题讨论】:
-
你找到解决办法了吗?
-
@DiogoMagro 我已经在答案部分回答了解决方案
标签: javascript node.js angular webpack sass