Npm听起来像是一个在组织中使用的很棒的平台,很好奇是否可以像Nexus/Maven那样使用私人回购。谷歌上什么都没有出现:(
当前回答
Verdaccio是我一直在寻找的东西,它应该有自己的答案;)这是Sinopia的一个积极维护的分支(高度好评的答案)。它是一个作为npm包的npm注册表,可以在这里找到
在这里:https://github.com/verdaccio/verdaccio 在这里:https://www.verdaccio.org 端口号:4873
使用PM2运行
npm i -g verdaccio pm2
pm2 start --name verdaccio `which verdaccio`
pm2 save
使用docker运行
docker run -it --rm --detach --name verdaccio -p 4873:4873 verdaccio/verdaccio
使用头盔运行
helm repo add verdaccio https://charts.verdaccio.org
helm repo update
helm install verdaccio/verdaccio
其他回答
有点晚了,但是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:-)
如果我不太理解你的问题,请原谅,但我的回答是:
你可以创建一个私有的npm模块,并使用npm的普通命令来安装它。大多数node.js用户使用git作为他们的存储库,但你可以使用任何适合你的存储库。
在你的项目中,你需要一个NPM包的框架。大多数 节点模块有git存储库,您可以在其中查看它们如何 集成与NPM(包。json文件,我相信是 这和NPM的网站向你展示了如何制作一个NPM包) 使用类似于Make的东西来制作和压缩你的包 可以从互联网或您的网络上获取,以便为NPM准备 安装下载。 一旦你的包装制作完成,就可以使用了 NPM安装
我想这个帖子需要更新。如果你看看任何可用的npm注册表,它们都非常繁重,需要couchdb。Gemfurry和其他人需要你放弃公共回购。一些像shadow-npm这样的npm没有最近的提交。
然后,我们找到了雷吉。它有一个很好的提交活动,非常容易安装和使用,并有相当好的社区支持。它的重量非常轻,你不需要处理couchdb等。
https://github.com/isaacs/npmjs.org/: 在npm v1.0.26版本中,你可以在包中指定私有git存储库url作为依赖项。json文件。我没有使用它,但希望得到反馈。以下是你需要做的:
{
"name": "my-app",
"dependencies": {
"private-repo": "git+ssh://git@yourgitserver.com:my-app.git#v0.0.1",
}
}
可调试:私有npm模块
Verdaccio是我一直在寻找的东西,它应该有自己的答案;)这是Sinopia的一个积极维护的分支(高度好评的答案)。它是一个作为npm包的npm注册表,可以在这里找到
在这里:https://github.com/verdaccio/verdaccio 在这里:https://www.verdaccio.org 端口号:4873
使用PM2运行
npm i -g verdaccio pm2
pm2 start --name verdaccio `which verdaccio`
pm2 save
使用docker运行
docker run -it --rm --detach --name verdaccio -p 4873:4873 verdaccio/verdaccio
使用头盔运行
helm repo add verdaccio https://charts.verdaccio.org
helm repo update
helm install verdaccio/verdaccio
推荐文章
- npm start和npm run start的区别
- 有没有办法修复包锁。json lockfileVersion所以npm使用特定的格式?
- 如何使用npm全局安装一个模块?
- 实时http流到HTML5视频客户端的最佳方法
- 使用node.js下载图像
- Node.js Express中的HTTP GET请求
- Node.js:将文本文件读入数组。(每一行都是数组中的一项。)
- npm犯错!错误:EPERM:操作不允许,重命名
- Node Sass还不支持当前环境:Linux 64位,带false
- 我如何添加环境变量启动。VSCode中的json
- 解析错误:无法读取文件“…/tsconfig.json”.eslint
- 编译typescript时'tsc命令未找到'
- 在Node.js中'use strict'语句是如何解释的?
- 当WebSockets可用时,为什么要使用AJAX ?
- 使用过程。TypeScript中的env