0
votes

I have been trying to set up a typescript angular2 project structure as shown in the documentation. but the problem is it fails to install typings due to timeout. i tried changing to a particular version but no luck there too. Below is the error i'm getting when i use npm install

typings ERR! message Unable to connect to "https://api.typings.org/entries/dt/co re-js/tags/0.0.0%2B20160317120654" typings ERR! caused by connect ETIMEDOUT 104.24.112.177:443

typings ERR! cwd C:\Users\nayakb\workspace\AngularJS2\angular2-tutorial typings ERR! system Windows_NT 6.1.7601 typings ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\nayakb\w orkspace\AngularJS2\angular2-tutorial\node_modules\typings\dist\bin.js" "i nstall" typings ERR! node -v v5.9.1 typings ERR! typings -v 1.0.4 typings ERR! code EUNAVAILABLE

typings ERR! If you need help, you may report this error at: typings ERR! https://github.com/typings/typings/issues

npm WARN optional Skipping failed optional dependency /chokidar/fsevents: npm WARN notsup Not compatible with your operating system or architecture: fseve [email protected] npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\nayakb\AppData\ \Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" npm ERR! node v5.9.1 npm ERR! npm v3.9.2 npm ERR! code ELIFECYCLE npm ERR! [email protected] postinstall: typings install && gulp check.version s && npm prune && gulp webdriver npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] postinstall script 'typings install & & gulp check.versions && npm prune && gulp webdriver'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the angular2-seed package , npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR!
typings install && gulp check.versions && npm prune && gulp webdriv er npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs angular2-seed npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls angular2-seed npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR!
C:\Users\nayakb\workspace\AngularJS2\angular2-tutorial\npm-debug.lo g

If its possible for a work around. i would love to learn about it.

Thanks in advance

3
When you get a timeout from the typings api server maybe just retry in a few minutes. I can connect to it without any error.rinukkusu

3 Answers

2
votes

By adding .typingsrc file to the project root directory with the following content

proxy="http://proxy.company.com:8080"
rejectUnauthorized=false

and the rest just works fine without any trouble.

1
votes

ETIMEDOUT occurs because of you not receiving any response from typings source. Now this may occur when you are behind corporate proxy. mostly typings install tries to download files mentioned in typings.json file which are hosted on github. if that is the case then use either of the solution:

  1. you need to bypass proxy with npm config command. see this link.
  2. Alternatively, you can place the files locally in your code structure. for ex for jasmine.d.ts in tsconfig folder:

        "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#d594ef506d1efe2fea15f8f39099d19b39436b71"
    

    go to above url and paste the source code in a jasmine.d.ts file created locally anywhere in your current directory and then use

    <reference path = "../../jasmine.d.ts">
    

    in files which give typescript compile time error. Using this may cause the npm to give same error again but it will remove any typescript compile time error. so launch your application even after typings install fail.

Note : use ./ if jasmine.d.ts present in same directory & ../ to jump directories.

hope this helps!

0
votes

Remove node modules folder and Try clearing npm cache: npm cache clear. Then try npm install and see if it works.