3

这是我的 package.json 文件中的依赖项:

"dependencies": {
    "@angular/common": "2.0.0",
    "@angular/compiler": "2.0.0",
    "@angular/core": "2.0.0",
    "@angular/forms": "2.0.0",
    "@angular/http": "2.0.0",
    "@angular/platform-browser": "2.0.0",
    "@angular/platform-browser-dynamic": "2.0.0",
    "@angular/router": "3.0.0",
    "@angular/upgrade": "2.0.0",
    "angular2-in-memory-web-api": "0.0.20",
    "angular2-jwt": "^0.1.22",
    "bootstrap": "^3.3.6",
    "core-js": "^2.4.1",
    "es6-promise": "^3.1.2",
    "es6-shim": "^0.35.1",
    "es7-reflect-metadata": "^1.6.0",
    "jwt-decode": "^2.0.1",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.12",
    "systemjs": "0.19.27",
    "zone.js": "^0.6.23"
  },

我收到有关 angular2-jwt 依赖的警告,但我需要这个包。这是一条警告信息:

UNMET PEER DEPENDENCY rxjs@5.0.0-beta.12
npm WARN angular2-jwt@0.1.22 requires a peer of rxjs@5.0.0-beta.11

有什么想法吗,谢谢。

4

4 回答 4

0

错误:(SystemJS)XHR 错误(404 Not Found)正在加载http://localhost:3000/ng2-dropdown-treeview

或者

+-- ng2-dropdown-treeview@0.1.4
+-- UNMET PEER DEPENDENCY rxjs@5.0.0-beta.12
`-- UNMET PEER DEPENDENCY zone.js@0.6.26

我在 system.config.js 文件中添加了依赖项ng2-dropdown-treeview,然后它对我有用。

'rxjs': 'npm:rxjs',
        'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
        'lodash': 'npm:lodash/lodash.min.js',
        'ng2-dropdown-treeview': 'npm:ng2-dropdown-treeview/bundles/ng2-dropdown-treeview.umd.js',
于 2017-02-24T07:41:41.343 回答
0

Such a warning can be ignored. angular2-jwt just needs it peer dependencies updated to match the release version of angular2. Everything will work and is installed as expected

于 2016-09-15T07:38:04.140 回答
0

可以肯定的是,你有 package.json 字符串:

"devDependencies": {
    ....
  },
  "dependencies": {
    ....
    "@types/systemjs": "^0.19.32",
    "angular": "^1.5.0",
    "angular-animate": "^1.5.0",
    "angular-mocks": "^1.5.0",
    "base64-js": "^1.2.0",
    "bower": "^1.3.12",
    ....
  }
于 2017-01-14T21:42:05.177 回答
0

您需要在 sytemjs 中告诉 angular2-jwt 路径在哪里,因此您需要包含在地图对象中。'angular2-jwt': 'npm:angular2-jwt/angular2-jwt.js'

于 2016-09-15T21:12:43.673 回答