我有一个express项目,它访问一些常见的节点代码,这些代码保存在github的私有存储库中。在我的package.json文件中有一行代码,如下所示
git+ssh://git@github.com:MYGITHUBACCT/MYPROJECT.git#master
当我运行npm install时,一切都正常工作,它从私有存储库中提取我的公共代码,并将其放在我的node_modules目录中。但是,当我运行npm update时,它在我的私有repo上失败,并显示以下内容:
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
为了运行更新并从GitHub中提取更新,我需要在package.json中执行一些特殊操作吗?
谢谢
金妮
发布于 2012-12-30 07:36:28
Apparently, this is still an open issue with npm。
同时,要更新git依赖项,您必须先删除它们,然后执行npm install
。
rm -rf node_modules/MYPROJECT
npm install
发布于 2014-01-26 01:09:26
npm中有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
https://stackoverflow.com/questions/13920799
复制相似问题