npm install without ssl

前端 未结 4 1495
遇见更好的自我
遇见更好的自我 2020-12-04 15:43

I have an Ubuntu VM that is having trouble connecting to sites with ssl, i.e. https. It can successfully download artifacts from the internet if the url begins with http.

4条回答
  •  无人及你
    2020-12-04 15:59

    After much trial and error I found that in addition to all that was said above, I also need to set the https-proxy to the value of the http proxy.

    So the end .npmrc file looks like

    proxy=http://username:password@proxy.address:port/
    https-proxy=http://username:password@proxy.address:port/
    strict-ssl=false
    registry=http://registry.npmjs.org/
    

    Note that proxy and https-proxy are identical!

    See the comments on this thread for more info:

    https://github.com/npm/npm/issues/8034

    Also I ran a npm cache clean --force after updating the npmrc for good measure but I am not sure if it is required.

    Hope that helps.

提交回复
热议问题