【问题标题】:Why is npm install react-router-dom not working?为什么 npm install react-router-dom 不起作用?
【发布时间】:2020-10-13 05:06:07
【问题描述】:

这样开始,但从不继续:

[..................] / rollbackFailedOptional: verb npm-session c63c949f06e27b29

然后过了一会儿,它失败了。这是错误信息:

npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to http://registry.npmjs.org/react-router-dom failed, reason: connect ETIMEDOUT 104.16.27.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\Eddie\AppData\Roaming\npm-cache\_logs\2020-06-23T07_31_04_992Z-debug.log

【问题讨论】:

  • 你正在运行什么命令?
  • 要么是 NPM 出现问题,要么是您的计算机网络出现问题,或者您的计算机和 NPM 之间存在问题。
  • @Alvin.Kamau 请检查下面的答案,这可能会有所帮助
  • 尝试使用 vpn 可能会有帮助。

标签: node.js reactjs react-router npm-install react-router-dom


【解决方案1】:

此错误是由于代理设置不正确造成的。验证网络代理设置是否正确。

否则,请尝试使用以下命令删除代理设置,然后重试。

$ npm config rm 代理

$ npm config rm https-proxy

【讨论】:

  • 我已经这样做了,但似乎没有区别。
猜你喜欢
  • 2021-04-04
  • 2019-12-31
  • 2016-12-25
  • 2021-03-15
  • 2022-11-01
  • 1970-01-01
  • 2020-07-31
  • 2018-07-31
  • 2022-06-16
相关资源
最近更新 更多