在Windows Behind Proxy Server上安装angular-cli [英] Installing angular-cli on Windows Behind Proxy Server

查看:71
本文介绍了在Windows Behind Proxy Server上安装angular-cli的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在从公司代理服务器的后面构建Angular 2演示,该演示具有阻止NPM和TypeScript'typings'安装的已知问题.虽然我可以通过代理服务器设置解决这些问题,但是我不确定如何处理最新的问题.

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.

每当我尝试全局安装angular-cli时:

Whenever I try to install angular-cli globally:

npm install -g angular-cli

,甚至在本地使用现有 npm init 设置(包括package.json文件)的目录:

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安装错误

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?

谢谢.

推荐答案

要将npm模块加载到代理服务器后面,您需要在node.js终端中键入以下命令:

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

  1. npm配置设置代理 http://proxy.company.com:8080
  2. npm配置设置https-proxy http://proxy.company.com:8080
  1. npm config set proxy http://proxy.company.com:8080
  2. npm config set https-proxy http://proxy.company.com:8080

这篇关于在Windows Behind Proxy Server上安装angular-cli的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆