How to clear https proxy setting of NPM?

前端 未结 30 2052
长发绾君心
长发绾君心 2020-11-29 14:59

How can I clear the previous ssl proxy setting of NPM? well, I search a lot, but all post I got is mainly about how to set proxy in corporate network.

相关标签:
30条回答
  • 2020-11-29 15:36

    Try deleting them with:

    npm config delete proxy
    npm config delete https-proxy
    
    0 讨论(0)
  • 2020-11-29 15:38

    Nothing above worked for me. I had to edit the file ".npmrc" which will be under user home directory (ex: c:\users\abcuser) :

    http_proxy=null
    registry=https://registry.npmjs.org/
    strict-ssl=true
    proxy=null
    
    0 讨论(0)
  • 2020-11-29 15:39
    npm config rm proxy
    npm config rm https-proxy
    

    Worked for me

    0 讨论(0)
  • 2020-11-29 15:41
    npm config rm proxy
    npm config rm https-proxy
    unset HTTP_PROXY
    unset HTTPS_PROXY
    unset http_proxy
    unset https_proxy
    

    Damn finally this does the trick in Debian Jessie with privoxy (ad remover) installed, Thank you :-)

    0 讨论(0)
  • 2020-11-29 15:41

    I was struggling with this for ages. What I finally did was go into the .npmrc file (which can be found in the user's directory followed by the user's name, ie. C:\Users\erikj/.npmrc), opened it with a text editor, manually removed any proxy settings and changed the http:// setting to https://. In this case, it is a matter of experimenting whether http or https will work for you. In my case, https worked. Go figure.

    0 讨论(0)
  • 2020-11-29 15:42

    Http Module is deprecated and it is replaced with HttpClient.

    Change your imports to import { HttpClientModule } from '@angular/common/http';

    0 讨论(0)
提交回复
热议问题