Install Angular Behind The Corporate Proxy

Install Angular Behind The Corporate Proxy

Corporate proxy issue in angular/ Proxy issue/ Firewall issue for NPM registry

  1. Create a file named  .npmrc  inside C:\Users\<username> folder.

    **<username> (Like : A200….. or Jivendra) is different for everyone.

  2. Copy the below content in .npmrc file created in the first step.

    registry=http://registry.npmjs.org/

    strict-ssl=false

    proxy=http://<userid>:<password>@10.24.19.116:8080

    http-proxy= http://<userid>:<password>@10.24.19.116:8080

    https_proxy= http://<userid>:<password>@10.24.19.116:8080

    Note: If the password contains special char (E.g:- jivendra@123), then encode the password using any online URL Encoder tool and paste the encoded value in place of a password. 10.24.19.116:8080 is your corporate proxy IP, modify it according to your proxy value.

    To get the company-specific proxy IP, Contact your Team Lead.

  3. Open a command prompt and run the below command 

    npm install -g @angular/cli

    Note: Node should have been installed properly in your system before installing angular. Verify cmd: node -v and npm -v

  4. After step 3 we are supposed to create path variables in our system. 

  5. First, tap on Path as highlighted in the below snapshot.

  6. After that tap on Edit and then New as highlighted in the below snapshot. 

  7. Then we are supposed to add 2 path URLs as mentioned below. 

    C:\Users\<username>\AppData\Roaming\npm

    C:\Users\<username>\AppData\Roaming\npm\node_modules\@angular\cli

    Note: **<username> is different for everyone! 

  8. After all the steps are done we can check if angular is installed successfully with the below command. 

    Command: ng version  

  9. Note: If the user has multiple registries and does not want to set up angular globally to disturb the existing project then create a specific working folder and paste the .npmr content inside that folder. Now your angular setup scope is limited to only that particular folder.