简体   繁体   English

Npm安装git https地址,但它查找SSH

[英]Npm install git https address but it looks for SSH instead

Hi I am looking for some help on installing private in-house npm modules in a Node project. 嗨,我正在寻找有关在Node项目中安装内部私有npm模块的帮助。

I just started writing a node library which I can install by specifying its git's url. 我刚刚开始编写一个节点库,可以通过指定其git的URL进行安装。

The problem I have is: I specified the dependency let say sample_module : sample_module的问题是:我指定了依赖关系,比如说sample_module

git+https://{token}:x-oauth-basic@github.com:{repo_org/repo_name}

However when I do npm install , it installs via ssh. 但是,当我执行npm install ,它是通过ssh安装的。

I want to use https only because of certain rules in collaboration. 我仅由于协作中的某些规则才想使用https。 May I know if I could know why even if I specify https in the module url, it still goes to ssh protocol? 我是否可以知道为什么即使我在模块url中指定https,它仍然使用ssh协议? How should I force or change it to HTTPS only? 如何强制或仅将其更改为HTTPS?

Thank you! 谢谢!

I think your sample_module is set up to also support ssh, note the git in git+https:// 我觉得你的sample_module设置也支持SSH,注意gitgit+https://

Try setting the remote url as https://{token}:x-oauth-basic@github.com:{repo_org/repo_name} to see if it helps to default the behavior to use just https. 尝试将远程URL设置为https://{token}:x-oauth-basic@github.com:{repo_org/repo_name}以查看是否将默认行为设为仅使用https会有所帮助。

See https://help.github.com/articles/changing-a-remote-s-url/ 参见https://help.github.com/articles/changing-a-remote-s-url/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM