依赖项的角度材质抛出错误

时间:2018-08-13 16:30:03

标签: angular npm dependencies angular-material

在项目中安装角形材料时出现此错误:

  

未捕获的TypeError:Object(...)不是函数       在bidi.es5.js:87       在Object ../ node_modules/@angular/cdk/esm5/bidi.es5.js(bidi.es5.js:89)       位于 webpack_require (引导程序:76)       在Object ../ node_modules/@angular/material/esm5/core.es5.js(http.js:2764)       位于 webpack_require (引导程序:76)       在Object ../ node_modules/@angular/material/esm5/toolbar.es5.js(core.es5.js:2769)       位于 webpack_require (引导程序:76)       在Object ../ src / app / content / content.module.ts(content.component.ts:8)       位于 webpack_require (引导程序:76)       在Object ../ src / app / app.module.ts(app.component.ts:8)

我的package.json是以下

{
  "name": "camaleonmanager",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --extract-css",
    "build:ssr": "npm run build -- --app=ssr --output-hashing=media",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^6.1.2",
    "@angular/cdk": "^6.4.4",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/material": "^6.4.4",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/platform-server": "^5.2.0",
    "@angular/router": "^5.2.0",
    "@nguniversal/module-map-ngfactory-loader": "^5.0.0",
    "angular-font-awesome": "^3.1.2",
    "angular2-jwt": "^0.2.3",
    "aspnet-prerendering": "^3.0.1",
    "bootstrap": "^4.1.3",
    "core-js": "^2.5.7",
    "font-awesome": "^4.7.0",
    "jquery": "^3.3.1",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.7.2",
    "@angular/cli": "^6.1.2",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/jasmine": "^2.8.8",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "^6.0.116",
    "codelyzer": "^4.4.3",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^2.0.5",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.4.3",
    "karma-jasmine": "^1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3"
  },
  "optionalDependencies": {
    "node-sass": "^4.9.0"
  }
}

似乎我有一些依赖项错误...。但是我不明白所涉及的库是什么。...我使用的是angular-jwt2,我认为该程序包与@ angular / core不兼容6 ....

如果您知道问题出在哪里,那么如果您说我如何在将来发现依赖问题,我将非常感谢。

非常感谢, 问候

1 个答案:

答案 0 :(得分:0)

最后,我找到了解决方案。没有本机工具可以将所有软件包更新到最新版本,因此需要npm-check-updates。使用ncu -u,package.json文件将更新为每个软件包的最新版本。上一个命令完成后,请使用npm install更新软件包。

就我而言,我需要安装rxjs-compat并执行npm install rxjs@6 rxjs-compat@6 --save