10

I get the following error when I try to run- npm install. error as below:

npm ERR! node v0.12.12
npm ERR! npm  v3.3.6
npm ERR! code ELIFECYCLE
npm ERR! angular2-quickstart@1.0.0 postinstall: `typings install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular2-quickstart@1.0.0 postinstall script 'typings ins
tall'.
npm ERR! This is most likely a problem with the angular2-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     typings install
npm ERR! You can get their info via:
npm ERR!     npm owner ls angular2-quickstart
npm ERR! There is likely additional logging output above.

How do I resolve this?

Smitha
  • 6,110
  • 24
  • 90
  • 161

4 Answers4

13

Make sure you have typings package installed.

npm install -g typings

Also make sure you have typings.json file available.

You can follow this tutorial, from the Angular2 team.

Shaunak
  • 17,377
  • 5
  • 53
  • 84
4

Not the same error, but I had a proxy issue that was causing typings install to fail: if you had a proxy issue for npm then you will have a proxy issue for typings too.

The error I was getting is:

typings ERR! message Unable to connect to "https://api.typings.org/entries/dt/selenium-webdriver/tags/2.44.0%2B20160317120654"
typings ERR! caused by connect ECONNREFUSED 104.24.112.177:443

I fixed this by creating a settings file for typings in my %HOMEPATH% folder:

%HOMEPATH%\.typingsrc

proxy=http://DOMAIN%5Cusername:password@proxy:port/
https-proxy=http://DOMAIN%5Cusername:password@proxy:port/
rejectUnauthorized=false

See these links for more details: the first one suggests putting the .typingsrc file in your project folder, but you can use the home folder like npm.

Community
  • 1
  • 1
satnhak
  • 9,407
  • 5
  • 63
  • 81
0

I am behind corporate proxy, I just tried with creating a file .typingsrc with the below content and placed in the root folder of my application

{
"proxy":"http://proxy-server:8080",
"rejectUnauthorized": false
}

It worked finally..

kkam
  • 1
  • 1
0

Make sure you have not-too-old npm version. You can see how to upgrade here.

After you have a new npm version, install the typings package:

npm install -g typings
Community
  • 1
  • 1
Tal Haham
  • 1,500
  • 12
  • 16