Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm ERR! peerinvalid during npm install step of Angular 2 Quickstart

I have node v4.4.0 and npm v2.14.20 installed on OS X (El Capitan).

I'm following steps described on 5 Min Quickstart - ts page that's available on Angular 2 official site.

However I come across the following error when I execute npm install.

npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants es6-shim@^0.33.3

In order to be able to isolate the problem this is what I have done.

  1. Create an empty project folder.
  2. On the empty folder I have executed npm init with empty values to generate an empty package.json.
  3. I have added the following dependencies to my package.json.

    "dependencies": {
      "angular2": "2.0.0-beta.9",
      "es6-shim": "^0.35.0"
    }
    
  4. I executed npm install and observe the same error above.

This is the peerDependencies inside package.json of /node_modules/angular2

"peerDependencies": {
  "es6-promise": "^3.0.2",
  "es6-shim": "^0.33.3",
  "reflect-metadata": "0.1.2",
  "rxjs": "5.0.0-beta.2",
  "zone.js": "0.5.15"
}

Given the ^0.33.3 version requirement for es6-shim peer dependency, shouldn't es6-shim be installed fine with version 0.35.0? What is the problem that I fail to see?

like image 495
onat Avatar asked Dec 24 '22 07:12

onat


2 Answers

I had the same problem, except that I have Windows10. I solved it by upgrading my Node.js from 4.4.1 LTS to 5.9.0 Stable.

like image 108
laci0725 Avatar answered Dec 28 '22 09:12

laci0725


Try this version of package.json, that should do it

{
  "name": "angular2-quickstart",
  "version": "1.0.0",
  "scripts": {
    "start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "lite": "lite-server",
    "typings": "typings",
    "postinstall": "typings install"
  },
  "license": "ISC",
  "dependencies": {
    "angular2": "2.0.0-beta.9",
    "systemjs": "0.19.24",
    "es6-promise": "^3.0.2",
    "es6-shim": "^0.33.3",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.2",
    "zone.js": "0.5.15"
  },
  "devDependencies": {
    "concurrently": "^2.0.0",
    "lite-server": "^2.1.0",
    "typescript": "^1.8.7",
    "typings":"^0.7.5"
  }
}
like image 36
Mehdi Avatar answered Dec 28 '22 09:12

Mehdi