AWS Elastic Beanstalk,无法安装bitbucket上托管的node.js私有模块

时间:2015-05-18 18:43:22

标签: node.js amazon-web-services npm elastic-beanstalk

我试图将node.js应用程序部署到Elastic Beanstalk。

在我的主package.json中,我有一个托管在Bitbucket上的私有模块。

"dependencies": {
"my-module": "git+https://<API-KEY>:x-oauth-basic@bitbucket.org/<team>/my-module.git"}

您可以将此案例视为参考:NPM private git module on Heroku

我做完后:eb deploy

我的npm安装无法标记以下错误:

npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror ssh://git@bitbucket.org/<team>/my-module.git /root/.npm/_git-remotes/ssh-git-bitbucket-org- <team>-my-module-git-ac810b24
npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror ssh://git@bitbucket.org/<team>/my-module.git /root/.npm/_git-remotes/ssh-git-bitbucket-org-<team>-my-module-git-ac810b24: Cloning into bare repository '/root/.npm/_git-remotes/ssh-git-bitbucket-org-<team>-my-module-git-ac810b24'...
npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror ssh://git@bitbucket.org/<team>/my-module.git /root/.npm/_git-remotes/ssh-git-bitbucket-org-<team>-my-module-git-ac810b24: Permission denied (publickey).
npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror ssh://git@bitbucket.org/<team>/my-module.git /root/.npm/_git-remotes/ssh-git-bitbucket-org-<team>-my-module-git-ac810b24: fatal: Could not read from remote repository.
npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror ssh://git@bitbucket.org/<team>/my-module.git /root/.npm/_git-remotes/ssh-git-bitbucket-org-<team>-my-module-git-ac810b24:
npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror ssh://git@bitbucket.org/<team>/my-module.git /root/.npm/_git-remotes/ssh-git-bitbucket-org-<team>-my-module-git-ac810b24: Please make sure you have the correct access rights
npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror ssh://git@bitbucket.org/<team>/my-module.git /root/.npm/_git-remotes/ssh-git-bitbucket-org-<team>-my-module-git-ac810b24: and the repository exists.
npm ERR! Linux 3.14.35-28.38.amzn1.x86_64
npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v0.12.2-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v0.12.2-linux-x64/bin/npm" "--production" "install"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code 128

npm ERR! Command failed: git clone --template=/root/.npm/_git-remotes/_templates --mirror ssh://git@bitbucket.org/<team>/my-module.git /root/.npm/_git-remotes/ssh-git-bitbucket-org-<team>-my-module-git-ac810b24
npm ERR! Cloning into bare repository '/root/.npm/_git-remotes/ssh-git-bitbucket-org-<team>-my-module-git-ac810b24'...
npm ERR! Permission denied (publickey).
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!
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!     /tmp/deployment/application/npm-debug.log

我不明白为什么会失败。

1 个答案:

答案 0 :(得分:0)

您从bitbucket收到错误Permission denied (publickey).。 Elasticbeanstalk部分很好,它没有权限下载您的私人仓库。您必须将公钥变为Bitbucket或使用HTTP身份验证。