npm install - git 问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24276026/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 10:07:37  来源:igfitidea点击:

npm install - git problems

gitnpmzshsteroids

提问by Kevin Baker

I am having problems getting the following command to work. I posted to the steroids.js forums, but this seems to be more of a generic git problem. All the repo's with a leading "git@" on the url fail.

我在使用以下命令时遇到问题。我在 steroids.js 论坛上发帖,但这似乎更像是一个通用的 git 问题。所有在 url 上带有前导“git@”的 repo 都失败了。

command

命令

npm install steroids -g

errors

错误

npm ERR! git clone https://[email protected]/AppGyver/incubator-ripple.git Cloning into bare repository '/Users/kbaker/.npm/_git-remotes/https-git-github-com-AppGyver-incubator-ripple-git-2c417fa2'...
npm ERR! git clone https://[email protected]/AppGyver/incubator-ripple.git 

npm ERR! git clone https://[email protected]/AppGyver/ios-sim.git 
npm ERR! git clone https://[email protected]/AppGyver/ios-sim.git fatal: Unable to look up [email protected] (port 9418) (nodename nor servname provided, or not known)
npm ERR! Error: Command failed: fatal: Unable to look up [email protected] (port 9418) (nodename nor servname provided, or not known)

I downloaded the github repo of the below npm package, adjusted the packages.json file to use repo url's that do not fail and I am still getting errors about missing packages.

我下载了以下 npm 包的 github repo,调整了 packages.json 文件以使用不会失败的 repo url,但我仍然收到有关丢失包的错误。

I've tried updating npm and git commands. Could this have somethign to do with the fact that I'm running zsh?

我试过更新 npm 和 git 命令。这可能与我正在运行 zsh 的事实有关吗?

Thoughts?

想法?

回答by jessh

Your clone url is incorrect. You're using:

您的克隆网址不正确。您正在使用:

https://[email protected]/AppGyver/incubator-ripple.git

Either use ssh:

要么使用 ssh:

[email protected]:AppGyver/incubator-ripple.git

or https:

或 https:

https://github.com/AppGyver/incubator-ripple.git

but not both

但不是两者兼而有之

回答by Herald Smit

I experienced this issue because of my proxy settings.

由于我的代理设置,我遇到了这个问题。

You can try installing it with:

您可以尝试使用以下方法安装它:

npm install git+https://github.com/AppGyver/steroids -g

npm install git+https://github.com/AppGyver/steroids -g

but I suggest configuring gitto transform giturls to httpswith:

但我建议配置git以将giturl转换为https

git config --global url."https://".insteadOf git://

git config --global url."https://".insteadOf git://

and then retry:

然后重试:

npm install steroids -g

npm install steroids -g