2015-06-08 32 views
1

我需要在AWS Beanstalk實例上通過npm安裝私有github模塊。AWS Beanstalk通過NPM安裝私有Github模塊導致身份驗證問題

我正在使用Github個人訪問令牌與github進行身份驗證並訪問回購。

package.json列出了依賴這樣的:

"privatepackage": "git+https://jaf91ja9jasflkjasf98109asf10asdf:[email protected]/user123/privatepackage.git"

然而,在魔豆部署時,我得到了以下錯誤:

npm ERR! node v0.12.2 
npm ERR! npm v2.7.4 
npm ERR! code 128 
npm ERR! Command failed: git clone --template=/tmp/.npm/_git-remotes/_templates --mirror [email protected] 
npm ERR! Cloning into bare repository '/tmp/.npm/_git-remotes/git-github-com... 
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. 
+0

你有沒有找到一個很好的解決這個問題?我發現了類似的問題和解決方案(例如下面的鏈接),但是想知道你是否找到了更好的解決方案。 https://stackoverflow.com/questions/24993092/how-to-use-a-private-npm-registry-on-elastic-beanstalk – pulekies

回答

0

我認爲你缺少你機器上的SSH密鑰並在github上添加。

請查看generating-ssh-keys哪些可以幫助您解決此問題。

+0

但是,我不需要SSH,因爲我使用個人訪問令牌。 – ac360

+0

好的,您是否有該回購的訪問權限。請確認。 – webpandit

+0

是的,完全訪問適當的範圍。 – ac360