Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

typings install behind proxy from within Visual Studio 2015/2017 gives error #780

Open
abhilashdk2016 opened this issue Mar 14, 2017 · 11 comments

Comments

@abhilashdk2016
Copy link

Hi,

I have the below package.json file

{
"version": "1.0.0",
"name": "opengamelistwebapp",
"private": true,
"dependencies": {
"@angular/common": "2.0.0-rc.5",
"@angular/compiler": "2.0.0-rc.5",
"@angular/core": "2.0.0-rc.5",
"@angular/http": "2.0.0-rc.5",
"@angular/platform-browser": "2.0.0-rc.5",
"@angular/platform-browser-dynamic": "2.0.0-rc.5",
"@angular/upgrade": "2.0.0-rc.5",
"core-js": "^2.4.1",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"systemjs": "^0.19.37",
"typings": "^1.3.2",
"zone.js": "^0.6.12"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-clean": "^0.3.2",
"gulp-concat": "^2.6.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-typescript": "^2.13.6",
"gulp-uglify": "^2.0.0",
"typescript": "^1.8.10"
},
"scripts": {
"postinstall": "typings install dt~core-js --global"
}
}

When I run npm install/or Choose Restore package from VS I get the below error

typings install dtcore-js --global
typings ERR! message https://api.typings.org/entries/dt/core-js/versions/latest responded with 403, expected it to equal 200
typings ERR!
typings ERR! cwd D:\Documents\Working\Microsoft\MVC_Core_ng2\OpenListWeb\OpenListWebApp
typings ERR! system Windows_NT 6.1.7601
typings ERR! command "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\Node.exe" "D:\Documents\Working\Microsoft\MVC_Core_ng2\OpenListWeb\OpenListWebApp\node_modules\typings\dist\bin.js" "install" "dt
core-js" "--global"
typings ERR! node -v v5.4.1
typings ERR! typings -v 1.5.0
typings ERR! code EINVALIDSTATUS
typings ERR!
typings ERR! If you need help, you may report this error at:
typings ERR! https://github.com/typings/typings/issues
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\Node.exe" "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v5.4.1
npm ERR! npm v3.3.4
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: typings install dt~core-js --global
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'typings install dtcore-js --global'.
npm ERR! This is most likely a problem with the opengamelistwebapp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! typings install dt
core-js --global
npm ERR! You can get their info via:
npm ERR! npm owner ls opengamelistwebapp
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\Documents\Working\Microsoft\MVC_Core_ng2\OpenListWeb\OpenListWebApp\npm-debug.log

I have my .typingsrc file as below

proxy="http://pac.lbs.alcatel-lucent.com/proxy.pac:80"
http-proxy="http://pac.lbs.alcatel-lucent.com/proxy.pac:80"
https-proxy="http://pac.lbs.alcatel-lucent.com/proxy.pac:80"
rejectUnauthorized=false

If I want to specify user name with domain (domain\username) how should I do that?
I tried below one, did not work
proxy="domain\username:password@http://pac.lbs.alcatel-lucent.com/proxy.pac:80"

The problem is my password contains @ symbol.

When I open the url https://api.typings.org/entries/dt/core-js/versions/latest in browser I get the below response:

{"tag":"0.9.0+20170310221640","version":"0.9.0","description":null,"compiler":null,"location":"github:DefinitelyTyped/DefinitelyTyped/core-js/index.d.ts#8dd753de5a1e97fe75d9d25df3d78c227c409309","updated":"2017-03-10T22:16:40.000Z"}

I am not able to install typings please can somebody help me out.

@abhilashdk2016
Copy link
Author

Hi Please can somebody help me out :)

@unional
Copy link
Member

unional commented Mar 16, 2017

Do you want to try npm install @types/core-js instead?

@abhilashdk2016
Copy link
Author

Hi I can try. I am really new to all this. Do I have to do any other modifications for my package.json or systemjs.config.js if i go by this way.

@unional
Copy link
Member

unional commented Mar 16, 2017

Nothing needed to change to the systemjs.config.js. Typings only needed in the node_modules folder so it can be discovered by the compiler / language service used by your IDE.

Install the typings as devDependencies:

npm install -D @types/core-js

Also, it is advisable to use the newer TypeScript (the @types above needs [email protected]+).

@unional
Copy link
Member

unional commented Mar 16, 2017

And you don't need typings as you dependencies.

@abhilashdk2016
Copy link
Author

So "typescript": "^1.8.10" should change to "typescript": "^2.0.0". Then execute npm install -D @types/core-js right?

@unional
Copy link
Member

unional commented Mar 16, 2017

Yes, or as you do npm install -D typescript@*, it will install the latest, which is 2.2.1

@abhilashdk2016
Copy link
Author

abhilashdk2016 commented Mar 16, 2017

Hi Thanks it worked. Now in app.module.ts I can remove ///<reference path="../../typings/index.d.ts"/> this line right. It's giving red squiggly so.

@unional
Copy link
Member

unional commented Mar 16, 2017

I don't know what that file is. 🌷

@abhilashdk2016
Copy link
Author

I am working on Angular 2 Application. app.module.ts file contains the main module class for the application and In a tutorial I saw ///<reference path="../../typings/index.d.ts"/> being referenced. My concern is after installing typings using the way you said should I still need a reference to the typings/index.d.ts file or not.

@bensontrent
Copy link
Contributor

bensontrent commented Apr 14, 2017

The tutorial where you saw "///<reference path=" is likely an old tutorial, and that's right, you shouldn't need that reference, Reference paths were needed before typescript 2.0 They have been replaced with options in the tsconfig file to direct the typescript compiler to the locations of your types. See instructions in the handbook for consuming types.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants