How do I list a private Github repo as a "dependency"
in package.json
? I tried npm's Github URLs syntaxes like ryanve/example
, but doing npm install
in the package folder gives "could not install" errors for the private dependencies. Is there a special syntax (or some other mechanism) for depending on private repos?
相关问题
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- google-drive can't get push notifications
- Failed at the electron@1.8.2 postinstall script
- How to add working directory to deployment in GitH
- How to reimport module with ES6 import
相关文章
- 请教Git如何克隆本地库?
- node连接远程oracle报错
- java开发bug问题:GitHub授权登录无法获取授权账号信息?
- How can make folder with Firebase Cloud Functions
- @angular-cli install fails with deprecated request
- Is there a Github markdown language identifier for
- “no implicit conversion of Integer into String” er
- GitHub:Enterprise post-receive hook
If someone is looking for another option for Git Lab and the options above do not work, then we have another option. For a local installation of Git Lab server, we have found that the approach, below, allows us to include the package dependency. We generated and use an access token to do so.
Of course, if one is using an access key this way, it should have a limited set of permissions.
Good luck!
It can be done via https and oauth or ssh.
https and oauth: create an access token that has "repo" scope and then use this syntax:
or
ssh: setup ssh and then use this syntax:
(note the use of colon instead of slash before user)
With git there is a https format
This format accepts User + password
So what you can do is create a new user that will be used just as a bot, add only enough permissions that he can just read the repository you want to load in NPM modules and just have that directly in your
packages.json
In Select Scopes part, check the on repo: Full control of private repositories
This is so that token can access private repos that user can see
Now create new group in your organization, add this user to the group and add only repositories that you expect to be pulled this way (READ ONLY permission !)
You need to be sure to push this config only to private repo
Then you can add this to your / packages.json (bot-user is name of user, xxxxxxxxx is the generated personal token)
https://blog.eq8.eu/til/pull-git-private-repo-from-github-from-npm-modules-or-bundler.html