npm通过依赖关系在package.json中安装私有github仓库 [英] npm install private github repositories by dependency in package.json

查看:1067
本文介绍了npm通过依赖关系在package.json中安装私有github仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过npm安装github私有存储库,其中包括其他私有github存储库作为依赖。

I'm trying to install github private repository by npm that includes other private github repositories as dependency.

尝试了很多方式和帖子,但没有工作。这是我在做什么:

Have tried a lot of ways and posts but none is working. Here is what i'm doing :

npm install git+https://github.com/myusername/mygitrepository.git

如下:

"dependencies": {
    "repository1name": "git+https://github.com/myusername/repository1.git",
    "repository2name": "git+https://github.com/myusername/repository2.git"
}

什么是正确的方法吗?

推荐答案

以下工作在我需要的所有情况下都很好:

The following worked just fine in all scenarios i needed :

"dependencies": {
"GitRepo": "git+https://<token-from-github>:x-oauth-basic@github.com/<user>/<GitRepo>.git"
}

这篇关于npm通过依赖关系在package.json中安装私有github仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆