-
Notifications
You must be signed in to change notification settings - Fork 3k
Can't force git to use https:// instead of git:// #5257
Comments
Note the location for the work-around replacement appears to have changed to |
I have this problem too, means I can't install some Atom packages. What is |
@callumlocke I assume they're referring to https://github.com/npm/npm/blob/master/lib/cache.js |
I am also having problems with this. I've updated .gitconfig to work but Atom still doesn't work. Annoying really. Hopefully a fix will come out for this! |
Out of curiosity, why exactly is NPM throwing out the environment in the first place? I know the comment says:
But I'm not sure what that means, exactly. What are the "weird ways" being referred to here? Also, I'm not sure why the code the OP referenced actually prevents us from using |
As far as I could tell without understanding javascript, at first glance
meant "for each entry in process.env, if the entry is not GIT_PROXY_COMMAND/SSH/SSL_NO_VERIFY, move on to the next entry, otherwise add the environment variable to the gitEnv list" the placement of the continue and the use of negation here is very confusing, and the comment doesn't exactly help things. I could be totally wrong and this isn't the line that's chucking things, but it looked like it needed to be revised/clarified regardless. |
@camillem Oops, I missed the Anyway, I wonder if we could fix this by adding |
It is indeed a pain that npm gets in git's way like this, but I don't have the time right now to come up with a fix. If somebody wants to start the process of making a (tested) change to support https, I'll be happy to land it. If not, it's probably going to be a month or two before we can get to it. |
Hey everyone, I figured this out!!! ...I think. Npm doesn't seem to use
I tested it out and it works great for me! |
I fixed this issue for several of my colleagues by running the following two commands:
One thing we noticed is that the |
This is nice, @LaurentGoderre! I think I'm going to add this to the troubleshooting guide right now. Eventually, I want the CLI to support this without having to hack around it, but this is a pretty sweet workaround, because it fixes more than just npm. |
Yeah! It solved problems for half a dozen developers for us! |
cheers @LaurentGoderre, worked a charm |
After reviewing the patch on #5621 and this issue, I've decided that @LaurentGoderre's approach is actually sufficient, without adding another difficult-to-test (and -debug) code path. Because we do have Laurent's instructions in the troubleshooting guide, I'm going to call this documented and resolved. If somebody wants to propose a patch that moves this configuration into the official npm documentation, I'm willing to work with them to land it, but keep in mind that the npm docs are meant for npm-specific things, and this is a more general Git configuration issue. |
👍 I don't think you guys should complicate your code base to accommodate super restrictive network environments if a workaround exists |
For bitbucket you would use: |
Git has a simple way to do this in the config file.
However npm seems to throw out the environment in lib/cache.js
So I can't inject a GIT_CONFIG or anything.
I've hand-hacked it into the
addRemoteGit
function inlib/cache.js
withbut this variable should be pulled from a config somewhere
The text was updated successfully, but these errors were encountered: