Bootstraap \ SASS:“表行变量”的参数数量错误(3个代表2)

时间:2019-06-17 23:39:01

标签: 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:类型'Subscription'缺少类型'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"
  }
}

对此我什么也没看到。在更新过程中有人遇​​到过这个问题吗?

谢谢!

1 个答案:

答案 0 :(得分:1)

好,所以我想出了一个例子:我正在升级一个旧项目以使用最新的库,这是出现的错误之一。问题是我的项目是@import单独导入bootstrap scss文件,如下所示:

add_filter( 'wc_session_expiration', function($seconds){ return 300;} );
add_filter( 'wc_session_expiring', function($seconds){ return 299;} );

当我用一个替换所有@import时,问题就消失了(依次导入当前引导程序版本的所有正确文件):

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

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