Suppose there is a working application in which we want to add a new functionality. To add new functionality, we need to install some packages from npm. When installing a new package, there are problems that are listed in the console. So the question is that if you try to do as it is written in the console, then there are conflicts with other packages. Based on the rules of semver.org most packages often change the last 2 digits, while, as written in the documentation, nothing should break, but a conflict arises. How to solve such problems? How do you resolve dependencies in npm?

Illustrative example:

├─┬ angular2-universal@2.1.0-rc.1 │ └── xhr2@0.1.4 ├── UNMET PEER DEPENDENCY rxjs@5.0.2 └── UNMET PEER DEPENDENCY zone.js@0.7.4 npm WARN angular2-jwt@0.1.27 requires a peer of rxjs@5.0.0-beta.12 but none was installed. npm WARN angular2-universal@2.1.0-rc.1 requires a peer of zone.js@~0.6.21 but none was installed. 

 { "name": "ddddd", "version": "0.0.0", "license": "MIT", "angular-cli": {}, "scripts": { "ng": "ng", "start": "ng serve", "lint": "tslint \"src/**/*.ts\"", "test": "ng test", "pree2e": "webdriver-manager update --standalone false --gecko false", "e2e": "protractor" }, "private": true, "dependencies": { "@angular/common": "^2.3.1", "@angular/compiler": "^2.3.1", "@angular/core": "^2.3.1", "@angular/forms": "^2.3.1", "@angular/http": "^2.3.1", "@angular/platform-browser": "^2.3.1", "@angular/platform-browser-dynamic": "^2.3.1", "@angular/router": "^3.3.1", "angular2-jwt": "^0.1.27", "angular2-universal": "^2.1.0-rc.1", "bootstrap": "^3.3.7", "core-js": "^2.4.1", "jquery": "^3.1.1", "ng2-bootstrap": "^1.1.16", "ng2-file-upload": "^1.1.4-2", "rxjs": "^5.0.2", "ts-helpers": "^1.1.1", "zone.js": "^0.7.4" }, "devDependencies": { "@angular/compiler-cli": "^2.3.1", "@types/jasmine": "2.5.38", "@types/node": "^6.0.42", "angular-cli": "1.0.0-beta.24", "codelyzer": "~2.0.0-beta.1", "jasmine-core": "2.5.2", "jasmine-spec-reporter": "2.5.0", "karma": "1.2.0", "karma-chrome-launcher": "^2.0.0", "karma-cli": "^1.0.1", "karma-jasmine": "^1.0.2", "karma-remap-istanbul": "^0.2.1", "protractor": "~4.0.13", "ts-node": "1.2.1", "tslint": "^4.0.2", "typescript": "~2.0.3" } } 
  • Add the full package.json to the question - Mikhail Vaysman
  • @MikhailVaysman added. - A50

0