Npm听起来像是一个在组织中使用的很棒的平台,很好奇是否可以像Nexus/Maven那样使用私人回购。谷歌上什么都没有出现:(
当前回答
这篇文章讨论了如何设置一个私有注册表
确保在系统中安装了couchdb 使用以下命令复制npmjs.org curl -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://isaacs.iriscouch.com/registry/", "target":"registry", "continuous":true, "create_target":true}' -H "Content-Type: application/json"
注意,该命令中有"continuous":true,这将利用CouchDB的_changes API,并在该API被通知时拉出任何新的更改。
如果你想停止这些复制,你可以很容易地添加"cancel":true。那么剧本就会
curl -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://isaacs.iriscouch.com/registry/", "target":"registry", "continuous":true, "create_target":true, "cancel":true}' -H "Content-Type: application/json"
然后转到npmjs.org自述me安装npm(确保安装了nodejs和git)。吹是所有的步骤
git clone git://github.com/isaacs/npmjs.org.git
cd npmjs.org
sudo npm install -g couchapp
npm install couchapp
npm install semver
couchapp push registry/app.js http://localhost:5984/registry
couchapp push www/app.js http://localhost:5984/registry
其他回答
支持私有npm注册库的存储库管理器:
Sonatype Nexus 2.10 Artifactory 3.2
如果我不太理解你的问题,请原谅,但我的回答是:
你可以创建一个私有的npm模块,并使用npm的普通命令来安装它。大多数node.js用户使用git作为他们的存储库,但你可以使用任何适合你的存储库。
在你的项目中,你需要一个NPM包的框架。大多数 节点模块有git存储库,您可以在其中查看它们如何 集成与NPM(包。json文件,我相信是 这和NPM的网站向你展示了如何制作一个NPM包) 使用类似于Make的东西来制作和压缩你的包 可以从互联网或您的网络上获取,以便为NPM准备 安装下载。 一旦你的包装制作完成,就可以使用了 NPM安装
这篇文章讨论了如何设置一个私有注册表
确保在系统中安装了couchdb 使用以下命令复制npmjs.org curl -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://isaacs.iriscouch.com/registry/", "target":"registry", "continuous":true, "create_target":true}' -H "Content-Type: application/json"
注意,该命令中有"continuous":true,这将利用CouchDB的_changes API,并在该API被通知时拉出任何新的更改。
如果你想停止这些复制,你可以很容易地添加"cancel":true。那么剧本就会
curl -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://isaacs.iriscouch.com/registry/", "target":"registry", "continuous":true, "create_target":true, "cancel":true}' -H "Content-Type: application/json"
然后转到npmjs.org自述me安装npm(确保安装了nodejs和git)。吹是所有的步骤
git clone git://github.com/isaacs/npmjs.org.git
cd npmjs.org
sudo npm install -g couchapp
npm install couchapp
npm install semver
couchapp push registry/app.js http://localhost:5984/registry
couchapp push www/app.js http://localhost:5984/registry
我想在列表中添加AWS Code Artifact服务,如果您的组织也在使用AWS git回购,看起来是一个不错的方法。
https://aws.amazon.com/blogs/devops/publishing-private-npm-packages-aws-codeartifact/
有点晚了,但是NodeJS(我猜在11月14日左右)支持企业NPM存储库-你可以在他们的官方网站上找到更多信息。
粗略地看一下,npmE似乎允许NPM存储库的倒挂镜像——也就是说,如果它在你的内部存储库中找不到包,它就会在真正的NPM存储库中查找包。看起来很有用!
npm Enterprise is an on-premises solution for securely sharing and distributing JavaScript modules within your organization, from the team that maintains npm and the public npm registry. It's designed for teams that need: easy internal sharing of private modules better control of development and deployment workflow stricter security around deploying open-source modules compliance with legal requirements to host code on-premises npmE is private npm npmE is an npm registry that works with the same standard npm client you already use, but provides the features needed by larger organizations who are now enthusiastically adopting node. It's built by npm, Inc., the sponsor of the npm open source project and the host of the public npm registry.
不幸的是,它不是免费的。你可以试用一下,但它是商业软件。这对独立开发者来说不是很好,但如果你是一个独立开发者,你有GitHub:-)
推荐文章
- Node -使用NODE_MODULE_VERSION 51根据不同的Node.js版本编译
- RabbitMQ / AMQP:单队列,同一消息的多个消费者?
- Node.js同步执行系统命令
- 禁用包的postinstall脚本
- Node.js上的html解析器
- 错误:无法找到模块“webpack”
- 在node.js中使用async / await文件系统
- NodeJS -用NPM安装错误
- 如何为本地安装npm包设置自定义位置?
- 回调函数来处理管道的完成
- Express函数中的“res”和“req”参数是什么?
- node.js TypeError:路径必须是绝对路径或指定根路径到res.sendFile[解析JSON失败]
- Passport.js -错误:序列化用户到会话失败
- Node.js vs .Net性能
- 从电子应用程序中删除菜单栏