【问题标题】:Error during npm installnpm 安装期间出错
【发布时间】:2018-04-04 11:11:26
【问题描述】:

每当我运行 npm install 时,我都会收到错误“无法访问'http://ikt.pm2.io/ikt.git/': 无法连接到 ikt.pm2.io 端口 80: Timed 出

例如,当我运行命令 npm install jest 时,它会卡住一段时间,然后抛出上述错误。我尝试从 Windows 控制台、Git Bash 和 VS Code 终端运行 npm install,但没有成功。

非常感谢任何帮助

【问题讨论】:

  • 您是否在代理服务器或防火墙之后?
  • @JeremyThille :是的,但我已经在 npmrc 中设置了代理设置
  • 你试过npm config set proxy http://user:password@proxy.com:portnpm config set https-proxy http://user:password@proxy.com:port吗?
  • @JeremyThille :这是代理问题,但对于 git 而不是 npm ,需要为 Git 设置代理设置,我已经发布了我的答案

标签: node.js npm-install


【解决方案1】:

经过一番挣扎,我发现我的 Git 配置设置有问题,如果你的背后代理,你的 git 配置中需要有代理属性。一旦我添加了代理设置,它就可以正常工作了

您可以使用命令检查 git config 设置

git config -l

如果代理设置不存在,使用添加它

git config --global http.https-proxy <your proxy>

【讨论】:

    猜你喜欢
    • 2015-03-21
    • 2016-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-05
    • 2015-10-01
    相关资源
    最近更新 更多