【问题标题】:npm install and npm start give error about githubnpm install 和 npm start 给出关于 github 的错误
【发布时间】:2016-04-16 18:27:29
【问题描述】:

我最近在 GitHub 上建立了一个私人仓库。现在,当我尝试进行 npm 安装时,npm start,这两个命令都不再起作用。对于npm install 我得到了

J:\workspace\epimss\angular2\ts\com-epimss.ng2.ts>npm install
npm ERR! git fetch -a origin (https://github.com/floridoo/gulp-sourcemaps.git) fatal: unable to access 'https://githu
b.com/floridoo/gulp-sourcemaps.git/': Failed to connect to github.com port 443: Timed out
npm ERR! git fetch -a origin (https://github.com/SitePen/remap-istanbul.git) fatal: unable to access 'https://github.
com/SitePen/remap-istanbul.git/': Failed to connect to github.com port 443: Timed out
npm ERR! fetch failed https://registry.npmjs.org/gulp-atom-electron/-/gulp-atom-electron-1.6.1.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 23.235.39.162:443
npm ERR! fetch failed https://registry.npmjs.org/gulp-atom-electron/-/gulp-atom-electron-1.6.1.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 23.235.39.162:443
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "P:\\Program Files\\nodejs\\node.exe" "P:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "
install"
npm ERR! node v5.8.0
npm ERR! npm  v3.7.3
npm ERR! code 128

npm ERR! Command failed: git -c core.longpaths=true fetch -a origin
npm ERR! fatal: unable to access 'https://github.com/floridoo/gulp-sourcemaps.git/': Failed to connect to github.com
port 443: Timed out
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     J:\workspace\epimss\angular2\ts\com-epimss.ng2.ts\npm-debug.log

我是 github 新手,只是不明白 github 应该参与尝试执行 npm install 或 npm start。

我正在使用带有默认 git/github 设置的 Webstorm IDE。我曾经能够提交并推送到私人仓库,但我不能再这样做了。

感谢任何帮助。谢谢。

【问题讨论】:

  • 你在代理后面吗?
  • 否 - 直接 DSL 连接到互联网。 Github 给我发了一封关于向我的 SSH 帐户添加公钥的电子邮件。这可能是我现在必须使用此密钥的问题吗?

标签: node.js git github npm


【解决方案1】:

如果由于任何原因通过 https 访问 GitHub 失败,请先尝试检查是否可以使用 ssh:

 url."ssh://git@github.com/".insteadOf https://github.com/

这意味着任何由 npm 模块到 github 的 git fetch 都将使用 ssh 协议而不是 https。

【讨论】:

    猜你喜欢
    • 2018-02-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-30
    • 2018-10-17
    • 1970-01-01
    • 2020-08-14
    • 2018-02-24
    相关资源
    最近更新 更多