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.
To load npm modules behind a proxy server you need to type in following commands in the node.js terminal:
- npm config set proxy http://proxy.company.com:8080
- npm config set https-proxy http://proxy.company.com:8080
I was able install angular-cli behind the corporate proxy, Need to follow the below steps:
- Install node/npm
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
- Cofigure 'gitbash' proxy run the below command:
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
Then hit the final command:
npm install -g angular-cli@latest
Try using Windows Power Shell which solved my issue.
Use this command with port.
npm config set https-proxy http://yours.com:1234
I have had ongoing problems with this issue for some time now. However, after the Final Release of Angular 2 and the accompanying update to the angular-cli package, I have been able to download and install angular-cli globally with no issues on a Windows 64-bit computer using the Command Prompt behind a proxy.
Hope this helps someone!