您可以为您的组织托管一个用于 npm 的私有存储库吗? [英] can you host a private repository for your organization to use with npm?

查看:19
本文介绍了您可以为您的组织托管一个用于 npm 的私有存储库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Npm 听起来像是在组织内使用的一个很好的平台,很好奇是否可以使用私有存储库,例如 Nexus/Maven.Google 上什么也没有出现 :(

Npm sounds like a great platform to use within an organization, curious if a private repo is possible, like with Nexus/Maven. Nothing comes up on Google :(

推荐答案

我认为没有什么简单的方法可以做到这一点.

I don't think there is an easy way to do this.

A 查看 npm 文档 告诉我们,这是可能的:

A look at the npm documentation tells us, that it is possible:

是的!

最简单的方法是复制 couch 数据库,并使用相同(或相似)的设计文档来实现 API.

The easiest way is to replicate the couch database, and use the same (or similar) design doc to implement the APIs.

如果您从官方 CouchDB 设置连续复制,然后将您的内部 CouchDB 设置为注册表配置,那么除了您的私有包之外,您还可以读取任何已发布的包,并且默认情况下只会发布内部.如果您随后想发布一个包供全世界查看,您可以简单地覆盖该命令的 --registry 配置.

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.

还有一个关于 如何创建私有 npm 仓库 时钟博客.

There's also an excellent tutorial on how to create a private npm repository in the clock blog.

编辑 (2017-02-26):

不是很新,但现在有付费计划 在 npm 上托管私有包.

Not really new, but there are now paid plans to host private packages on npm.

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

Over the years, npm has become a factor for many non-Node.js companies, too, through the huge frontend ecosystem that's built upon npm. If your company is already running Sonatype Nexus for hosting Java projects internally, you can also use it for hosting internal npm packages.

其他选项包括 JFrog ArtifactoryInedo ProGet,但我没用过.

Other options include JFrog Artifactory and Inedo ProGet, but I haven't used those.

这篇关于您可以为您的组织托管一个用于 npm 的私有存储库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆