node.js - 未满足与 ngx-webstorage 的对等依赖性但不想更新到 Angular 5.0.0

标签 node.js angular angular5

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

NPM 安装命令提示 ngx-webstorage 需要 angular 5.0.0 而我确实没有安装 5.0.0 因为项目的其余部分还不能使用它。

我全局安装了 node 版本 6.12 和 angular 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 来安装依赖项,然后看到“需要一个 peer of”消息。

$ 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 版本,它需要 angular 5.0.0 因为这显然不符合其他的 angular 版本要求,因为在所有情况下,它们仍然是 4。

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

感谢任何帮助。

最佳答案

显然,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

关于node.js - 未满足与 ngx-webstorage 的对等依赖性但不想更新到 Angular 5.0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48030171/

相关文章:

angular-cli - Angular 5 Service Workers 缓存刷新数据更新或插入

json - 语法错误: Unexpected end of input in Angular 5 service

node.js - NodeJS : for loop and promises

node.js - 同构 React 和 JSX - 将组件渲染为服务器上的字符串

node.js - 尝试使用 AES-128-ECB 算法加密时出错

html - Mat-tab 内的组件 : How to scroll inner component

javascript - 如何为此 Firebase 响应 JSON 构建 Typescript 接口(interface)?

angular5 - 从 Angular 4 更新到 Angular 5 后自定义 FormControl 失败

python - socketIO-客户端 - 运行时错误 : maximum recursion depth exceeded

javascript - 如何正确实现带id的路由?