Npm听起来像是一个在组织中使用的很棒的平台,很好奇是否可以像Nexus/Maven那样使用私人回购。谷歌上什么都没有出现:(


当前回答

支持私有npm注册库的存储库管理器:

Sonatype Nexus 2.10 Artifactory 3.2

其他回答

我不认为有一个简单的方法来做到这一点。

看看npm文档就知道,这是可能的:

Can I run my own private registry? Yes! The easiest way is to replicate the couch database, and use the same (or similar) design doc to implement the APIs. If you set up continuous replication from the official CouchDB, and then set your internal CouchDB as the registry config, then you'll be able to read any published packages, in addition to your private ones, and by default will only publish internally. If you then want to publish a package for the whole world to see, you can simply override the --registry config for that command.

在clock博客中也有一个关于如何创建私有npm存储库的优秀教程。

编辑(2017-02-26):

不是什么新鲜事,但是现在有付费计划在npm上托管私有包。

这些年来,通过建立在npm之上的巨大前端生态系统,npm也成为了许多非node .js公司的一个因素。如果你的公司已经在内部运行Sonatype Nexus来托管Java项目,你也可以用它来托管内部npm包。

其他选项包括JFrog Artifactory和Inedo ProGet,但我还没有用过。

我可能有点晚了,但这两个中的任何一个都可能对你有用:

http://www.jfrog.com/confluence/display/RTF/Npm+Repositories https://github.com/krakenjs/kappa

我想这个帖子需要更新。如果你看看任何可用的npm注册表,它们都非常繁重,需要couchdb。Gemfurry和其他人需要你放弃公共回购。一些像shadow-npm这样的npm没有最近的提交。

然后,我们找到了雷吉。它有一个很好的提交活动,非常容易安装和使用,并有相当好的社区支持。它的重量非常轻,你不需要处理couchdb等。

这是我所知道的最简单的方法——用Gemfury私有npm注册表在云中托管它。

它是免费的,你可以用你的Github账户登录。与建立自己的数据库相比,这样可以节省很多时间。

支持私有npm注册库的存储库管理器:

Sonatype Nexus 2.10 Artifactory 3.2