Installing angular-cli on Windows Behind Proxy Server

39,040

Solution 1

To load npm modules behind a proxy server you need to type in following commands in the node.js terminal:

  1. npm config set proxy http://proxy.company.com:8080
  2. npm config set https-proxy http://proxy.company.com:8080

Solution 2

  1. Download and install Nodejs https://nodejs.org/en/download/

  2. Check your proxy setting. Based on your organization it will be change. If proxy not define you need to define your proxy setting in to LAN setting.

enter image description here

  1. Run CMD as Administrator enter the command

    npm config set https-proxy http://10.10.20.60:80

enter image description here

  1. If you are going to install in to a remote PC or you need windows Active Directory credential for installation.

enter image description here

enter image description here

  1. run angular cli command:

    npm i –g angular-cli

enter image description here

Solution 3

I was able install angular-cli behind the corporate proxy, Need to follow the below steps:

  1. Install node/npm
  2. Configure proxy for Nodejs like below :

    Run the below commands

    npm config set proxy {your proxy server address}

    npm config set {your proxy server address}

3.Install "gitbash", as gitbash will help us download the packages from gitHub

  1. Cofigure 'gitbash' proxy run the below command:

git config --global http.proxy http://proxyuser:[email protected]:8080

Then hit the final command:

npm install -g angular-cli@latest

Share:
39,040
Mindsect Team
Author by

Mindsect Team

Running a great team over here at Mindsect. Legitimizing the choices our clients make through logistics consulting and industry analysis. I'm a PHP developer with knowledge of MySQL. Currently moving our larger applications over to Node.js with an emphasis on the MEAN stack of web app development. Nice to know ya!

Updated on July 09, 2022

Comments

  • Mindsect Team
    Mindsect Team almost 2 years

    I am currently building Angular 2 demos from behind a corporate proxy server with known issues for blocking both NPM and TypeScript 'typings' installs. While I have been able to work around these issues with proxy server settings, I'm a little unsure what to do about the latest issue.

    Whenever I try to install angular-cli globally:

    npm install -g angular-cli
    

    or even locally to a directory with an existing npm init setup (including package.json file):

    npm install angular-cli --save
    

    I receive the following error (all local paths replaced with ):

    angular-cli npm install error

    npm ERR! Error: EPERM: operation not permitted, rename 
    'C:\Users\<PATH>\node_modules\angular-cli\node_modules\babel-runtime' ->
    'C:\Users\<PATH>\node_modules\angular-cli\node_modules\.babel-runtime.DELETE'
    at FSReqWrap.oncomplete (fs.js:82:15)
    npm ERR! Please try running this command as root/Administrator.
    

    Anyone else having issues (or a solution) to this particular user permission issue?

    Thanks.

  • Alon Or
    Alon Or over 6 years
    And to check your current config: 1. npm config get proxy 2. npm config get https-proxy @Devaarth thx
  • supernova
    supernova over 5 years
    Actually , NPM installs proxy info in Drive/Users/%USER%/.npmrc file
  • Pathik Vejani
    Pathik Vejani about 5 years
    What if proxy is not there?
  • Mohammad Atiour Islam
    Mohammad Atiour Islam about 5 years
    @PathikVejani without proxy you can run command directly : npm i –g angular-cli
  • Mohammad Atiour Islam
    Mohammad Atiour Islam almost 5 years
    @PathikVejani remove special character from your password