0

I have installed angular2 material from npm. Now I want to install another package, but it gives error

npm ERR! peerinvalid The package @angular/[email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer @angular/[email protected] wants @angular/[email protected]
npm ERR! peerinvalid Peer @angular/[email protected] wants @angular/common@^2.0.0
npm ERR! peerinvalid Peer @angular/[email protected] wants @angular/[email protected]
npm ERR! peerinvalid Peer @angular/[email protected] wants @angular/[email protected]
npm ERR! peerinvalid Peer @angular/[email protected] wants @angular/[email protected]
npm ERR! peerinvalid Peer @angular/[email protected] wants @angular/[email protected]

I am using the last version of @angular/material, however it depends on @angular/common@^2.0.0. What should I do in order to fix conflicts and use these packages?

package.json:

{
  "name": "materialdesign",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "start": "ng serve",
    "lint": "tslint \"src/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update",
    "e2e": "protractor"
  },
  "private": true,
  "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/material": "^2.0.0-alpha.9-3",
    "@angular/platform-browser": "~2.0.0",
    "@angular/platform-browser-dynamic": "~2.0.0",
    "@angular/router": "~3.0.0",
    "bootstrap": "^3.3.7",
    "core-js": "^2.4.1",
    "rxjs": "5.0.0-beta.12",
    "ts-helpers": "^1.1.1",
    "watchman": "^0.1.8",
    "zone.js": "^0.6.23"
  },
  "devDependencies": {
    "@types/jasmine": "^2.2.30",
    "@types/node": "^6.0.42",
    "angular-cli": "1.0.0-beta.17",
    "codelyzer": "~0.0.26",
    "jasmine-core": "2.4.1",
    "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.9",
    "ts-node": "1.2.1",
    "tslint": "3.13.0",
    "typescript": "2.0.2"
  }
}
4
  • what is your @angular/common version? You can check it in packages.json file. Commented Oct 24, 2016 at 6:47
  • I updated the question with package.json. Commented Oct 24, 2016 at 6:51
  • npm install --save @angular/[email protected] try installing with version included. Commented Oct 24, 2016 at 6:55
  • It gives the same error. Commented Oct 24, 2016 at 7:02

1 Answer 1

1

Sounds like a dependency resolution issue; I had a similar problem that was fixed with these steps:

  1. Upgrade to the latest NodeJS version
  2. npm --version and make sure it's 3.10.x
  3. npm install
  4. npm rebuild
Sign up to request clarification or add additional context in comments.

5 Comments

@BünyaminSarıgül I added a bit to my answer. If you still face the problem, tell me: what do you see when you do npm --version? What about node --version?
npm 2.15.9, node v4.6.1
@BünyaminSarıgül I rewrote my answer.
I updated npm and checked its latest version, it shows 3.10.9 github.com/npm/npm/releases
It worked when I updated the npm to 3.10.9. Thanks for your help!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.