npm add root CA

前端 未结 2 661
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 16:26

I am looking for a way to add a custom CA to NPM so I can download from a location using said certificate (an internal git-server) without having to nuke all CA-checking wit

2条回答
  •  不知归路
    2020-12-12 16:47

    If Matts Answer isn't helping you:

    $env:NODE_EXTRA_CA_CERTS=path\to\certificate.pem; npm install worked for me in Windows Powershell.


    For DOS/cmd (pointed out by Marc in the comments)

    set NODE_EXTRA_CA_CERTS=C:\\path\\to\\certificate.pem
    npm install
    

提交回复
热议问题