Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing angular-cli on Windows Behind Proxy Server

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.

like image 598
Mindsect Team Avatar asked Sep 06 '16 14:09

Mindsect Team


People also ask

How npm install behind corporate proxy?

Go to command prompt or terminal depending on your machine(tip: hit Win + R and type cmd). In the command prompt type the following command npm config set proxy http://<username><password>@proxy-server-url>:<port> then config set https-proxy http://<username><password>@proxy-server-url>:<port> .

Can we install Angular CLI without npm?

Installing Angular CLI on Windows First, you need to have Node and npm installed on your development machine. There are many ways to do that, such as: using NVM (Node Version Manager) for installing and working with multiple versions of node in your system. using the official package manager of your operating system.

Does Angular CLI need to be installed globally?

Installing @angular/cli globally allow you to use 'ng' command everywhere. It's required to install locally because to your project, some specific @angular/cli version is required and newer versions maybe brake.

Will npm install install Angular CLI?

NPM is one of the prerequisites you require before installing Angular CLI. Angular will need to have Node. js in your system for it to run (the 8.


2 Answers

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
like image 171
Devaarth Avatar answered Oct 10 '22 14:10

Devaarth


  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

like image 22
Mohammad Atiour Islam Avatar answered Oct 10 '22 15:10

Mohammad Atiour Islam