npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY

前端 未结 10 1385
心在旅途
心在旅途 2020-12-07 07:50

I am trying all the ways of creating react application. I have tried with maven and now i am trying with crate-react-app build system from Facebook Incubators.

When

10条回答
  •  隐瞒了意图╮
    2020-12-07 08:35

    Changing the NPM repo URL to HTTP works as a quick-fix, but I wanted to use HTTPS.

    In my case, the proxy at my employer (ZScaler) was causing issues (as it acts as a MITM, causing certification verification issues)

    I forgot I found a script that helps with this and Git (for cloning GitHub repos via HTTPS had the same issue) and forked it for my use

    Basically, it does the following for git:

    git config --global http.proxy http://gateway.zscaler.net:80/
    git config --system http.proxy http://gateway.zscaler.net:80/
    

    and for Node, it adds proxy=http://gateway.zscaler.net:80/ to the end of c:\Users\$USERNAME\npm\.npmrc

    That solved the issue for me.

提交回复
热议问题