2012-12-17 67 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