The npm community forum has been discontinued.
To discuss usage of npm, visit the GitHub Support Community.
`npm install` with a local network git repo is failing
When I run
npm i my-repo I get the following error:
fatal: unable to access 'https://my-repo-location/': SSL certificate problem: unable to get local issuer certificate
my-repo is a git repository on my LAN accessible via https.
When I attempt using full verbosity,
npm i -ddd my-repo, I get the following in the log output:
2 info using email@example.com 3 info using firstname.lastname@example.org 4 verbose npm-session 286251eeda21c649 5 silly install loadCurrentTree 6 silly install readLocalPackageData 7 silly fetchPackageMetaData error for my-repo@git+https://my-repo-location Error while executing: 7 silly fetchPackageMetaData C:\Program Files\Git\cmd\git.EXE ls-remote -h -t https://my-repo-location 7 silly fetchPackageMetaData 7 silly fetchPackageMetaData fatal: unable to access 'https://my-repo-location/': SSL certificate problem: unable to get local issuer certificate 7 silly fetchPackageMetaData 7 silly fetchPackageMetaData exited with error code: 128
- When I attempt the failing GIT command myself on the command line,
C:\Program Files\Git\cmd\git.EXE ls-remote -h -t https://my-repo-location, it succeeds. So perhaps this is an issue with how npm itself runs git?
my-repo-locationuses a self-signed SSL certificate.
- I can reproduce this git error manually from the command line by removing the self-signed cert for
my-repo-locationfrom my custom
How do I
npm install, or further debug the install, of this repository? Is there a way to pass the trace environment variables to the npm git call (eg: GIT_TRACE)?
sslcainfo config to the system git config fixed the issue.
[http] sslCAInfo = C:/path/to/my/custom-ca-bundle.crt
The shell that npm runs git in (on Windows at least) does not use the git config for the user running the command, instead it uses only the system git config.