【问题标题】:npm install over mac book is saying "Please make sure you have the correct access rights..."npm install over mac book 说“请确保您具有正确的访问权限...”
【发布时间】:2018-09-19 03:47:00
【问题描述】:

我已经为 mac book 设置了 ssh 密钥,并且同样也更新到了 bitbucket。但是当我尝试执行 npm install 时,它会显示"Please make sure you have the correct access rights..."

我尝试使用 windows 设置 ssh 密钥,它工作正常。此问题仅在 Mac Book 中出现。

任何人有任何关于它的指针将不胜感激。

我的错误日志是:

npm ERR! git clone --template=/Users/sunbansa0/.npm/_git-remotes/_templates --mirror    ssh://git@us.tools.publicis.sapient.com/ccap/rcp-frontend.git /Users/sunbansa0/.npm/_git-remotes/git-ssh-git-us-tools-publicis-sapient-com-ccap-rcp-frontend-git-431fc206: ssh_exchange_identification: read: Connection reset by peer
npm ERR! git clone --template=/Users/sunbansa0/.npm/_git-remotes/_templates --mirror ssh://git@us.tools.publicis.sapient.com/ccap/rcp-frontend.git /Users/sunbansa0/.npm/_git-remotes/git-ssh-git-us-tools-publicis-sapient-com-ccap-rcp-frontend-git-431fc206: fatal: Could not read from remote repository.
npm ERR! git clone --template=/Users/sunbansa0/.npm/_git-remotes/_templates --mirror ssh://git@us.tools.publicis.sapient.com/ccap/rcp-frontend.git /Users/sunbansa0/.npm/_git-remotes/git-ssh-git-us-tools-publicis-sapient-com-ccap-rcp-frontend-git-431fc206: 
npm ERR! git clone --template=/Users/sunbansa0/.npm/_git-remotes/_templates --mirror ssh://git@us.tools.publicis.sapient.com/ccap/rcp-frontend.git /Users/sunbansa0/.npm/_git-remotes/git-ssh-git-us-tools-publicis-sapient-com-ccap-rcp-frontend-git-431fc206: Please make sure you have the correct access rights
npm ERR! git clone --template=/Users/sunbansa0/.npm/_git-remotes/_templates --mirror ssh://git@us.tools.publicis.sapient.com/ccap/rcp-frontend.git /Users/sunbansa0/.npm/_git-remotes/git-ssh-git-us-tools-publicis-sapient-com-ccap-rcp-frontend-git-431fc206: and the repository exists.
npm ERR! Darwin 16.7.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.11.3
npm ERR! npm  v3.10.10
npm ERR! code 128

npm ERR! Command failed: git clone --template=/Users/sunbansa0/.npm/_git-remotes/_templates --mirror ssh://git@us.tools.publicis.sapient.com/ccap/rcp-frontend.git /Users/sunbansa0/.npm/_git-remotes/git-ssh-git-us-tools-publicis-sapient-com-ccap-rcp-frontend-git-431fc206
npm ERR! Cloning into bare repository '/Users/sunbansa0/.npm

【问题讨论】:

    标签: git npm bitbucket npm-install


    【解决方案1】:

    我猜你正在使用 macOS “Sierra” (10.12) 或“High Sierra (10.13)。Apple 以他们的智慧改变了他们为 Sierra 实现 SSH 客户端的行为;结果, ssh-agent 不会自动添加任何密钥。您可以通过ssh-add -L 确认这一点,其中列出了 ssh-agent 当前已知的所有密钥。

    您可以通过在~/.ssh/config 中添加一个部分来纠正此问题:

    Host us.tools.publicis.sapient.com
        IdentityFile /path/to/private/key
        AddKeysToAgent yes
    

    这会在第一次使用时将命名密钥添加到 ssh-agent。只要代理正在运行,密钥就应该保留在代理中。

    【讨论】:

      猜你喜欢
      • 2013-07-15
      • 2018-07-05
      • 2020-11-11
      • 2018-08-05
      • 2014-11-13
      • 1970-01-01
      • 2020-05-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多