0

The following command works on my windows machine (behind a very sensitive corporate firewall):

git clone http://bitbucket.org/geowerkstatt-hamburg/masterportalapi.git

But the following

npm i git+http://bitbucket.org/geowerkstatt-hamburg/masterportalapi.git

is throwing the error:

npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote http://bitbucket.org/geowerkstatt-hamburg/masterportalapi.git
npm ERR! fatal: unable to access 'http://bitbucket.org/geowerkstatt-hamburg/masterportalapi.git/': SSL certificate problem: self signed certificate in certificate chain

npm ERR! A complete log of this run can be found in:
npm ERR!     N:\npm-cache\_logs\2022-02-09T14_04_50_080Z-debug-0.log

Weird thing is that I'm actually using http (TLS same result). I've tried all kinds of settings and environment variables for git and npm to disable checks for self signed certificates in the first place. I've linked my root certificate directly as a parameter/setting, put it and the BitBucket certificate in the windows certificate chain, looked through all kind of guides and forums and nothing worked. Tried various versions of node, npm and git too.

Background: The command that's not working is in a package.json file.

Revo
  • 150
  • 2
  • 10
  • Check to see which version of Git *you* invoke when you run it by hand, and which version *npm* invokes when npm runs it by machine: chances are there are two different Git installations, which use different certificate files. – torek Feb 09 '22 at 20:19
  • both share the same version. If I make sure use the same git that's being invoked it also works: C:\masterportal> "C:\Program Files\Git\cmd\git.EXE" clone http://bitbucket.org/geowerkstatt-hamburg/masterportalapi.git/ Cloning into 'masterportalapi'... warning: redirecting to https://bitbucket.org/geowerkstatt-hamburg/masterportalapi.git/ [...] Resolving deltas: 100% (1042/1042), done. – Revo Feb 10 '22 at 06:45

0 Answers0