与ngx-webstorage的未满足的对等依赖关系,但不想更新到Angular 5.0.0

时间:2017-12-30 01:39:12

标签: node.js angular angular5

我正在尝试构建一个其他人创建的项目,但却遇到了未满足的依赖问题。

NPM安装命令抱怨taht ngx-webstorage需要angular 5.0.0而且我确实没有安装5.0.0,因为项目的其余部分还没有使用它。

我全局安装了节点版本6.12并且具有角度CLI版本3.10

$ which npm
/usr/bin/npm
$ npm --version
3.10.10
$ which ng
/usr/bin/ng
$ ng --version

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.6.2
Node: 6.12.0
OS: linux x64
Angular: 
...

我使用全局安装的npm来安装依赖项,然后看到"需要一个"消息。

$ npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN ngx-webstorage@2.0.1 requires a peer of @angular/core@^5.0.0 but none was installed.
npm WARN ng2-pop-over@0.9.37 requires a peer of @angular/core@^2.4.0 but none was installed.
npm WARN ng2-pop-over@0.9.37 requires a peer of zone.js@^0.7.2 but none was installed.
npm WARN ng2-accordion@0.0.15 requires a peer of @angular/core@^2.0.0 but none was installed.
npm WARN @schematics/angular@0.0.49 requires a peer of @angular-devkit/schematics@0.0.34 but none was installed.

这是package.json

{
  "name": "perkin-elmer",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "prestart": "npm install",
    "start": "ng serve --proxy-config proxy.config.json",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^4.2.4",
    "@angular/common": "^4.2.4",
    "@angular/compiler": "^4.2.4",
    "@angular/core": "^4.2.4",
    "@angular/forms": "^4.2.4",
    "@angular/http": "^4.2.4",
    "@angular/platform-browser": "^4.2.4",
    "@angular/platform-browser-dynamic": "^4.2.4",
    "@angular/router": "^4.2.4",
    "@types/underscore": "^1.8.6",
    "ag-grid": "^13.3.1",
    "ag-grid-angular": "^13.3.0",
    "angular-2-dropdown-multiselect": "^1.6.3",
    "angular2-multiselect-checkbox-dropdown": "^1.5.0",
    "bootstrap": "^3.3.7",
    "core-js": "^2.4.1",
    "jquery": "^2.2.4",
    "lodash": "^4.17.4",
    "ng-dynamic-component": "^1.1.0",
    "ng2-accordion": "0.0.15",
    "ng2-bootstrap-modal": "^1.0.1",
    "ng2-pop-over": "^0.9.37",
    "ngx-treeview": "^1.2.5",
    "ngx-webstorage": "^2.0.1",
    "rxjs": "^5.4.2",
    "underscore": "^1.8.3",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "1.4.5",
    "@angular/compiler-cli": "^4.2.4",
    "@angular/language-service": "^4.2.4",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/lodash": "^4.14.91",
    "@types/node": "~6.0.60",
    "codelyzer": "~3.2.0",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~3.2.0",
    "tslint": "~5.7.0",
    "typescript": "~2.3.3"
  }
}

由于我没有开发软件包,我不确定为什么ngx-webstorage设置为需要版本2.0.1,这需要角度5.0.0,因为这显然不符合其他角度版本的要求,因为在所有情况下,这些仍然是4个。

我在npm网站上查看了ngx-webstorage 2.0.1的要求,而devDependencies确实是5.0.0,但是这个package.json怎么可能有效呢?我知道它有效,因为该应用程序正在其他网站上运行...

感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

显然,ngx-webstorage被放弃了。 (请参阅:https://github.com/PillowPillow/ng2-webstorage/pull/91

使用ngx-webstorage的Angular 6兼容分支:https://www.npmjs.com/package/@rars/ngx-webstorage/v/3.0.0

npm install @rars/ngx-webstorage --save