If you are attempting to get an Angular2 site running on your Windows work computer at XYZ MegaCorp the chances are that you are having problems getting through the company proxy.
There are (at least) two package managers that need to get through the proxy:
For NPM you need to add the following lines to the .npmrc
file:
proxy=http://[DOMAIN]%5C[USER]:[PASS]@[PROXY]:[PROXYPORT]/
https-proxy=http://[DOMAIN]%5C[USER]:[PASS]@[PROXY]:[PROXYPORT]/
For Typings you need to add the following lines to the .typingsrc
file:
proxy=http://[DOMAIN]%5C[USER]:[PASS]@[PROXY]:[PROXYPORT]/
https-proxy=http://[DOMAIN]%5C[USER]:[PASS]@[PROXY]:[PROXYPORT]/
rejectUnauthorized=false
These files probably don't exist yet, so you can create them as blank text files. They can be added to the project root (same place as package.json
or you can put them in %HOMEPATH%
and they will be available to all your projects.
The bit that isn't obvious and is the main reason people think the proxy settings aren't working is the %5C
which is the URL encode of the \
to separate the domain and user names. Thanks to Steve Roberts for that one: Using npm behind corporate proxy .pac