angular - Bootstrap \SASS : Wrong number of arguments (3 for 2) for `table-row-variant'

标签 angular sass bootstrap-4

刚刚更新到 Angular 8,我似乎无法解决这个问题。

这是错误

ERROR in ./src/vendor/styles/bootstrap-material.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/vendor/styles/bootstrap-material.scss)

模块构建失败(来自 ./node_modules/sass-loader/lib/loader.js):

@include table-row-variant($color, theme-color-level($color, $table-bg-level), theme-color-level($color, $table-border-level));
^
`table-row-variant' 的参数数量错误(3 对 2)
在/Users/jasonspick/Projects/Web/FamApp/node_modules/bootstrap/scss/_tables.scss (第 101 行,第 12 列)
src/vendor/libs/hover-dropdown/hover-dropdown.directive.ts(22,5) 中的错误:错误 TS2740:“订阅”类型缺少“EventEmitter<{}>”类型中的以下属性:__isAsync,发出、订阅、观察者和其他 16 个。

这是我的 package.json:
    {
  "name": "fam-angular",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "postinstall": "node ./ng-add-pug-loader.js"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^8.0.1",
    "@angular/common": "^8.0.1",
    "@angular/compiler": "^8.0.1",
    "@angular/core": "^8.0.1",
    "@angular/forms": "^8.0.1",
    "@angular/http": "^7.1.4",
    "@angular/platform-browser": "^8.0.1",
    "@angular/platform-browser-dynamic": "^8.0.1",
    "@angular/router": "^8.0.1",
    "@auth0/angular-jwt": "^2.1.0",
    "@ng-bootstrap/ng-bootstrap": "4.0.1",
    "@ng-select/ng-select": "^2.13.3",
    "@ngx-translate/core": "^11.0.1",
    "@reactivex/rxjs": "^5.5.12",
    "@swimlane/ngx-datatable": "^13.1.0",
    "angular-calendar": "~0.25.2",
    "angular2-ladda": "^2.0.0",
    "bootstrap": "^4.1.3",
    "chart.js": "^2.7.3",
    "core-js": "^2.6.1",
    "ng-autosize": "~1.1.0",
    "ng-bootstrap": "^1.6.3",
    "ng-cli-pug-loader": "^0.2.0",
    "ng2-archwizard": "~2.1.0",
    "ng2-charts": "^2.0.0-beta.21",
    "ng2-nouislider": "~1.7.7",
    "ngx-chips": "~1.9.1",
    "ngx-dropzone-wrapper": "~6.1.0",
    "ngx-mask": "^6.5.18",
    "ngx-perfect-scrollbar": "~6.2.0",
    "ngx-swiper-wrapper": "~6.2.1",
    "ngx-toastr": "^9.1.1",
    "node-sass": "^4.12.0",
    "plyr": "~2.0.18",
    "quill": "~1.3.6",
    "rxjs": "^6.5.2",
    "spinkit": "~1.2.5",
    "update": "^0.7.4",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.800.3",
    "@angular/cli": "^8.0.3",
    "@angular/compiler-cli": "^8.0.1",
    "@angular/language-service": "^8.0.1",
    "@types/jasmine": "^2.8.14",
    "@types/jasminewd2": "^2.0.6",
    "@types/node": "^8.10.39",
    "apply-loader": "^2.0.0",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^5.4.2",
    "pug": "^2.0.3",
    "pug-loader": "^2.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "3.4.5"
  }
}

我没有看到任何东西。有没有人在更新过程中遇到这个问题?

谢谢!

最佳答案

好的,所以我在我的情况下想通了:我正在升级一个旧项目以使用最新的库,这是弹出的错误之一。问题是我的项目是单独@importing bootstrap scss 文件,如下所示:

@import 'node_modules/bootstrap/scss/root';
@import 'node_modules/bootstrap/scss/print';
@import 'node_modules/bootstrap/scss/reboot';
[...]

当我用单个 @imports 替换所有这些 @imports 时,问题就消失了(这反过来又导入了当前引导版本的所有正确文件):
@import 'node_modules/bootstrap/scss/bootstrap';

希望这对某人有所帮助,网络上几乎没有关于此错误的信息。

关于angular - Bootstrap \SASS : Wrong number of arguments (3 for 2) for `table-row-variant' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56640064/

相关文章:

javascript - 如何在 Angular 中删除双向数据绑定(bind) -2/4

javascript - 正则表达式在 Angular2 中不起作用

html - 内联 SVG 因 Flexbox 而消失

css - 如果我正确使用 body 位置 :absolute and display:flex 有什么好处

node.js - typescript 编译器突然开始产生错误

angular - : 'component selector' is not a known element: running ng-build on angular 5 app 中出现错误

html - 为什么我的图像被截断了? Css 面包屑导航栏

django - 一起使用 Django 和 Bootstrap Studio

bootstrap-4 - Bootstrap 4 导航栏切换器汉堡按钮不起作用

python - Django - 在结果页面的搜索框中显示查询