How to clear https proxy setting of NPM?

前端 未结 30 2051
长发绾君心
长发绾君心 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:32

    The easiest way to remove any configuration at all from npm is to edit the npm config file. It only takes two(2) commands to do this; one to open npm config file for editing, the other to confirm your change.

    1. type npm config list to view a list of all npm configurations that are active.
    2. type npm config edit to open a text editor with npm configurations. To remove the proxy line ( or simply comment it out ).
    3. Save the config file and close it.
    4. type npm config list to confirm that the proxy configuration has been removed.

    C'est la vie!

    I tried everything listed on this page, none worked, then I tried to the config edit. It worked instantly. (I use Windows 10)

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

    execute npm config list it will list down all proxy values.. in my case proxy value was fetched form global npmrc file, removed it and was able to complete npm install on my windows machine

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

    This was already answered but I think the --global config is not covered properly.

    By running npm config rm proxy you remove proxy from user configuration.
    This can be easily verified by running: npm config list.

    If there is proxy or https-proxy setting set in global config you have to use --global in the command to remove it.

    So at the end this will clean-up proxies from both local and global configs:

    npm config rm proxy
    npm config rm https-proxy
    npm config --global rm proxy
    npm config --global rm https-proxy
    
    0 讨论(0)
  • 2020-11-29 15:34

    Got exactly the same problem, I keep seeing my proxy configuration even after removing the npmrc file and deleting the keys.

    I found out that npm were using windows env key http-proxy by default.

    So go in Computer->Properties->Advanced system settings->Environement variables and check there is no http-proxy key configured.

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

    then

    npm config get proxy
    

    null

    also

    npm i -g bower to update
    

    npm had a bug on the proxy

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

    Try This,

    npm config delete http-proxy

    npm config delete https-proxy

    npm config rm proxy

    npm config rm https-proxy

    set HTTP_PROXY=null

    set HTTPS_PROXY=null

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