简体   繁体   English

私人回购的NPM更新失败

[英]NPM Update failing for private repo

I have an express project that accesses some common node code that I keep in a private repository in github. 我有一个快速项目,访问我保存在github中的私有存储库中的一些常见节点代码。 I have a line like the following in my package.json file 我的package.json文件中有如下所示的行

git+ssh://git@github.com:MYGITHUBACCT/MYPROJECT.git#master

When I run npm install, everything works correctly and it pulls my common code from the private repo and places it in my node_modules directory. 当我运行npm install时,一切正常,它从私有仓库中提取我的公共代码并将其放在我的node_modules目录中。 However, when I run npm update, it fails on my private repo and displays the following: 但是,当我运行npm update时,它在我的私人仓库上失败并显示以下内容:

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

Is there anything special I need to do in the package.json so that I can run the update and have it pull from GitHub? 在package.json中我需要做些什么特别的事情,以便我可以运行更新并从GitHub中获取它吗?

Thanks 谢谢

Ginny 金妮

Apparently, this is still an open issue with npm . 显然,这仍然是npm的一个悬而未决的问题

Meanwhile, to update git dependencies, you have to remove them first and then doing an npm install . 同时,要更新git依赖项,您必须先删除它们然后再进行npm install

rm -rf node_modules/MYPROJECT
npm install

This have fixed in npm, please upgrade to npm >= 1.3.10 这已在npm中修复 ,请升级到npm> = 1.3.10

Sample usage 样品用法

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

Some day later 一天后

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

Then npm install again and you will get new ref! 然后npm install再次npm install ,你会得到新的参考!

If your "myGitHubRepo/repo.js" is a private package you should set "private": true there to ensure it doesn't get accidentally published to npm registry 如果您的“myGitHubRepo / repo.js”是私有包,则应设置"private": true以确保它不会被意外发布到npm注册表

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM