【问题标题】:npm does not work behind corporate proxy and launched from apmnpm 在公司代理后面不起作用并从 apm 启动
【发布时间】:2017-04-19 10:53:24
【问题描述】:

我在代理后面遇到了 npm 问题。

npm install 失败,因为从 apm 启动时 npm 无法 git clone,这很奇怪,因为 apm 外的相同命令行可以工作。

npm ERR! Command failed: git -c core.longpaths=true fetch -a origin
npm ERR! fatal: Unable to look up github.com (port 9418) (Unknown host.)

.npmrc 内容

proxy=http://proxy-xxx:8080
http-proxy=http://proxy-xxx:8080
https-proxy=http://proxy-xxx:8080

.gitconfig 内容

[url "https://"]
    insteadOf = git://
[url "https://github.com/"]
    insteadOf = git@github.com:
[http]
    proxy = proxy-xxx:8080

似乎它来自 git URL,这很奇怪,因为手动启动时相同的命令有效。

我错过了什么?

【问题讨论】:

    标签: node.js git atom-editor


    【解决方案1】:

    在插件安装期间,HOME 环境已设置为%USERPROFILE%\.atom\.node-gyp。它明显不同于通常的 git 执行。 因此,我通过将描述 HTTPS 代理设置和架构替换规则的 .gitconfig 放在那里绕过了这个问题。

    干杯, 亚恩

    【讨论】:

      猜你喜欢
      • 2015-04-23
      • 2014-10-28
      • 1970-01-01
      • 2020-10-04
      • 1970-01-01
      • 1970-01-01
      • 2019-11-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多