在代理服务器后面的 Windows 上安装 angular-cli [英] Installing angular-cli on Windows Behind Proxy Server

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

问题描述

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

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

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

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