2012-12-17 66 views
3

我有一個快速項目,訪問我保存在github的私人存儲庫中的一些常見的節點代碼。我有類似下面的一行在我的package.json文件NPM更新失敗的私人回購

git+ssh://[email protected]:MYGITHUBACCT/MYPROJECT.git#master 

當我運行NPM安裝,一切正常,並將其拉我從私人回購協議,並將其放置在我node_modules目錄的通用代碼。然而,當我運行NPM更新,它沒有在我的私人回購,並顯示以下內容:

npm ERR! 404 'MYPROJECT' is not in the npm registry. 
npm ERR! 404 You should bug the author to publish it 
npm ERR! 404 
npm ERR! 404 Note that you can also install from a 
npm ERR! 404 tarball, folder, or http url, or git url. 

npm ERR! System Darwin 12.2.0 
npm ERR! command "node" "/usr/local/bin/npm" "update" 
npm ERR! cwd /Users/ginnyd/dev/gg-web 
npm ERR! node -v v0.8.16 
npm ERR! npm -v 1.1.69 
npm ERR! code E404 

有什麼特別的,我需要在的package.json做,這樣我可以運行更新並將其拉來自GitHub?

感謝

金妮

回答

0

這有fixed在NPM,請升級到故宮> = 1.3.10

使用範例

"dependencies": { "thing": "git://github.com/myGitHubRepo/repo.js.git#56477cb", }

有一天後來

"dependencies": { "thing": "git://github.com/myGitHubRepo/repo.js.git#67f90b5", }

然後npm install再次,你會得到新的參考!

如果你的「myGitHubRepo/repo.js」是private包你應該設置"private": true存在,以確保它不會accidentally published to npm registry