自动降级Node中的所有依赖项

时间:2018-07-24 17:34:53

标签: node.js angular

这里有点不愉快的问题,我目前正在从事angular项目。但是我想知道是否有可能降级该项目中的所有依赖项,以便它们彼此兼容。我当前使用的是Angular Core 5.2.0,但似乎没有与该Angular版本兼容的'ngx-signalr-hubservice'版本,它需要有角度的Core 4.3.2 ...这就是我的包装中的内容.json:

    "dependencies": {
"@angular/animations": "^5.2.0",
"@angular/cdk": "^5.2.0",
"@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": "^5.2.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"angular-confirm": "^2.0.0-alpha.2",
"core-js": "^2.4.1",
"hammerjs": "^2.0.8",
"jquery": "^3.3.1",
"ng-drag-drop": "^4.0.1",
"ng2-signalr": "^5.0.0",
"rxjs": "^5.5.6",
"signalr": "^2.2.3",
"zone.js": "^0.8.19"
    },
    "devDependencies": {
"@angular/cli": "~6.0.8",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ngx-signalr-hubservice": "^2.0.7",   <- This one is incompatible
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "~2.5.3",
"@angular-devkit/build-angular": "~0.6.8"
    }

所以...解决此问题的最佳方法是什么?另外,这是我的第一个StackOverflow帖子,请怜悯我;)

1 个答案:

答案 0 :(得分:0)

有很多用于前进版本的工具和有用的选项……我不知道有什么方法可以轻松地向后前进。

您可以这样做:npm install @angular/core@4.3.2

但是您必须确切知道所需的每个库的版本。

您可以尝试安装较旧版本的Angular CLI,并使用它为您生成package.json文件。然后,您将知道需要安装的正确库集。

认为是与Angular 4.x兼容的'npm install -g @ angular / cli @ 1.2.4`。