Npm听起来像是一个在组织中使用的很棒的平台,很好奇是否可以像Nexus/Maven那样使用私人回购。谷歌上什么都没有出现:(
当前回答
我们使用的是Sonatype Nexus,版本是Nexus Repository ManagerOSS 3.6.1-02。我确信它支持NPM私有存储库和缓存包。
其他回答
我可能有点晚了,但这两个中的任何一个都可能对你有用:
http://www.jfrog.com/confluence/display/RTF/Npm+Repositories https://github.com/krakenjs/kappa
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
我想在列表中添加AWS Code Artifact服务,如果您的组织也在使用AWS git回购,看起来是一个不错的方法。
https://aws.amazon.com/blogs/devops/publishing-private-npm-packages-aws-codeartifact/
这篇文章讨论了如何设置一个私有注册表
确保在系统中安装了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
这是我所知道的最简单的方法——用Gemfury私有npm注册表在云中托管它。
它是免费的,你可以用你的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性能
- 从电子应用程序中删除菜单栏