代码之家  ›  专栏  ›  技术社区  ›  Ozzy Walsh

从专用BitBucket安装NPM模块时主机密钥验证失败

  •  0
  • Ozzy Walsh  · 技术社区  · 7 年前

    我正在尝试从私有Bitbucket存储库安装NPM模块。

    我可以成功地运行 npm install 在我的系统本地,但在服务器上失败。

    错误是:

    npm ERR! Error while executing:
    npm ERR! /bin/git ls-remote -h -t ssh://git@bitbucket.org/myorg/my-repo.git
    npm ERR! 
    npm ERR! 
    npm ERR! (ssh-askpass:10260): Gtk-WARNING **: cannot open display: :0.0
    npm ERR! Host key verification failed.
    npm ERR! fatal: Could not read from remote repository.
    npm ERR! 
    npm ERR! Please make sure you have the correct access rights
    npm ERR! and the repository exists.
    npm ERR! 
    npm ERR! exited with error code: 128
    

    奇怪的是,手动克隆服务器上的repo工作正常: git clone git@bitbucket.org:myorg/my-repo

    因此ssh密钥配置正确。

    1 回复  |  直到 7 年前
        1
  •  0
  •   VonC    7 年前

    这表明npm命令的执行帐户与用于在服务器上手动克隆repo的帐户不同。

    在NPM帐户中, the ~/.known_hosts would need to be updated first