社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Git

包中的git依赖项。json错误与“拒绝访问(公钥)”?

Nihal • 3 年前 • 1302 次点击  

最初我的包裹里有这个。依赖项第3行的json:

  "dependencies": {
    "auth0-js": "^9.13.4",
    "core-js": "^3.6.5",
    "felix.ui": "git+ssh://git@bitbucket.org/felix/felix.ui.git#1.2.3"
    "es6-promise": "^4.2.8",
    "lodash": "^4.17.21",
...

它不工作,安装时出现错误。

git@bitbucket.org: Permission Denied(publickey)

我把它改成了https格式,它成功了。

"felix.ui": "https://mygitusername:mygitpassword@bitbucket.org/felix/felix.ui.git#1.2.3",

我有两个ssh密钥对:一个用于我的公共git配置文件,另一个用于我的组织/工作相关的东西。这是Windows 10。配置文件(即ssh/Config)如下所示:

# Github (default)
  Host gh
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa

# Bitbucket (secondary)
  Host bb
  HostName bitbucket.org
  User git
  IdentityFile ~/.ssh/id_rsa_work
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/129870
 
1302 次点击  
文章 [ 2 ]  |  最新文章 3 年前
Nihal
Reply   •   1 楼
Nihal    3 年前

我使用了带有凭据的https repo URL,它成功了。

谢谢你的回答。

VonC
Reply   •   2 楼
VonC    3 年前

如果你想要你的 id_rsa_work 要使用私钥,您应该将Git配置为使用 .ssh/config Bitbucket 进入

git config --global url."Bitbucket:".insteadOf git+ssh://git@bitbucket.org/

这样,ssh URL就会变成:

git+ssh://git@bitbucket.org/felix/felix.ui.git#1.2.3
# to
Bitbucket:felix/felix.ui.git#1.2.3