安装角度CLI时出错

时间:2017-08-21 06:43:29

标签: angular angular-cli

我在公司网络上安装 angularCLI 时遇到此超时错误。以下是我的错误日志:

C:\Users\A0724458>npm install -g @angular/cli
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli"
npm ERR! node v6.11.2
npm ERR! npm  v3.10.10
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect

npm ERR! network connect ETIMEDOUT 151.101.8.162:443
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\A0724458\npm-debug.log

有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

如果您在代理服务器后面工作,则需要对其进行配置。在命令行中运行以下命令。

npm config set proxy <your proxy server>
npm config set https-proxy <your proxy server>

此外,您可能需要将属性strict-ssl设置为false

npm config set strict-ssl false