npm 无法安装 angular-cli [英] npm Unable to Install angular-cli

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

问题描述

我正在尝试通过 npm 安装 angular-cli.我安装了最新版本的 Nodejs 和 git.我没有使用任何代理服务器(通过 netsh winhttp show proxy 以及 Internet Explorer LAN 设置对其进行了验证)并且我的互联网连接没有问题.当我尝试运行

I am trying to install angular-cli via npm. I have the recent version of Nodejs and git installed. I am not behind any proxy server(verified it through netsh winhttp show proxy as well as through Internet Explorer LAN settings) and there is no problem with my internet connection. When i try to run

npm install -g angular-cli 然后我得到以下错误

C:\Windows\system32>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 v7.3.0
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.192.162:80
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 settin
gs.
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:\Windows\system32\npm-debug.log

我尝试通过 npm cache clean 清理缓存,并尝试通过

I tried cleaning the cache through npm cache clean and also tried to change the registry to http:\ via

npm config set registry http://registry.npmjs.org/

我也尝试卸载 nodejs 并重新安装它,但它不起作用.我收到同样的错误.任何想法.

I also tried uninstalling nodejs and reinstalling it again but it is not working. I am getting the same error. Any ideas.

推荐答案

是的,这可能是由防火墙或代理引起的.你能ping npm注册主机并获取一个简单的文件吗?

Yes, this can be caused either by a firewall or a proxy. Can you ping the npm registry host and fetch a simple file?

> ping registry.npmjs.org
> npm view npm version

如果 ping 不成功,请检查您的连接或禁用防火墙.

If the ping is not successful, check your connection or disable your firewall.

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

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