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


当前回答

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

看看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,但我还没有用过。

其他回答

如果你更喜欢分散的方法,你也可以使用Aragon包管理器:

使用APM: http://blog.aragon.one/using-apm-to-replace-npm-and-other-centralized-package-managers/ 部署APM: https://github.com/aragon/aragonOS#apm

我们使用的是Sonatype Nexus,版本是Nexus Repository ManagerOSS 3.6.1-02。我确信它支持NPM私有存储库和缓存包。

如果我不太理解你的问题,请原谅,但我的回答是:

你可以创建一个私有的npm模块,并使用npm的普通命令来安装它。大多数node.js用户使用git作为他们的存储库,但你可以使用任何适合你的存储库。

在你的项目中,你需要一个NPM包的框架。大多数 节点模块有git存储库,您可以在其中查看它们如何 集成与NPM(包。json文件,我相信是 这和NPM的网站向你展示了如何制作一个NPM包) 使用类似于Make的东西来制作和压缩你的包 可以从互联网或您的网络上获取,以便为NPM准备 安装下载。 一旦你的包装制作完成,就可以使用了 NPM安装

我想在列表中添加AWS Code Artifact服务,如果您的组织也在使用AWS git回购,看起来是一个不错的方法。

https://aws.amazon.com/blogs/devops/publishing-private-npm-packages-aws-codeartifact/

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

看看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,但我还没有用过。