安装 React 时出现 NPM ETIMEDOUT 错误 [英] NPM ETIMEDOUT Error while installing React

查看:154
本文介绍了安装 React 时出现 NPM ETIMEDOUT 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 上执行以下命令:

I am executing following command on Windows:

npm install -g create-react-app

但是我收到以下错误:

npm 错误!代码 ETIMEDOUTnpm 错误!错误号超时npm 错误!对 http://registry.npmjs.org/create-react-app 的网络请求失败,原因:连接 ETIMEDOUT 104.16.20.35:80npm 错误!网络 这是一个与网络连接相关的问题.npm 错误!网络 在大多数情况下,您使用的是代理或网络设置不佳.npm 错误!网络npm 错误!网络 如果您使用代理,请确保npm 错误!网络代理"配置设置正确.请参阅:'npm 帮助配置'npm 错误!可以在以下位置找到此运行的完整日志:npm 错误!C:\Users\faizanmubasher\AppData\Roaming\npm-cache_logs\2019-02-20T13_22_23_493Z-debug.log

npm ERR! code ETIMEDOUT npm ERR! errno ETIMEDOUT npm ERR! network request to http://registry.npmjs.org/create-react-app failed, reason: connect ETIMEDOUT 104.16.20.35:80 npm ERR! network This is a problem 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! A complete log of this run can be found in: npm ERR! C:\Users\faizanmubasher\AppData\Roaming\npm-cache_logs\2019-02-20T13_22_23_493Z-debug.log

虽然我已经正确设置了代理配置:

Though I have properly set the proxy configurations:

npm config set http-proxy username:password@proxyip:port -g

npm config set proxy username:password@proxyip:port -g

npm config set https-proxy username:password@proxyip:port -g

也试过这个:

npm --proxy username:password@proxyip:port\ install -g create-react-app

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