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模块,并使用npm的普通命令来安装它。大多数node.js用户使用git作为他们的存储库,但你可以使用任何适合你的存储库。
在你的项目中,你需要一个NPM包的框架。大多数 节点模块有git存储库,您可以在其中查看它们如何 集成与NPM(包。json文件,我相信是 这和NPM的网站向你展示了如何制作一个NPM包) 使用类似于Make的东西来制作和压缩你的包 可以从互联网或您的网络上获取,以便为NPM准备 安装下载。 一旦你的包装制作完成,就可以使用了 NPM安装
这是我所知道的最简单的方法——用Gemfury私有npm注册表在云中托管它。
它是免费的,你可以用你的Github账户登录。与建立自己的数据库相比,这样可以节省很多时间。
这篇文章讨论了如何设置一个私有注册表
确保在系统中安装了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
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模块
支持私有npm注册库的存储库管理器:
Sonatype Nexus 2.10 Artifactory 3.2
推荐文章
- 如何在vue-cli项目中更改端口号
- 如何查看npm包的大小?
- 同步和异步编程(在node.js中)的区别是什么?
- 如何编辑通过npm安装的节点模块?
- “node_modules”文件夹应该包含在git存储库中吗
- 使用package.json在全局和本地安装依赖项
- this.libOptions.parse不是一个函数
- 对嵌套文件夹运行npm install的最好方法是什么?
- 节点Multer异常字段
- 在Ubuntu上安装Bower
- 很好的初学者教程socket.io?
- CALL_AND_RETRY_LAST分配失败-进程内存不足
- 在Ubuntu上安装Node.js
- 使用express.js代理
- Node -使用NODE_MODULE_VERSION 51根据不同的Node.js版本编译