How to clear https proxy setting of NPM?

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

    this works for me fime

    proxy=http://<username>:<pass>@proxyhost:<port>
    
    https-proxy=http://<uname>:<pass>@proxyhost:<port>
    

    sample in my instance username:uname and password:pword

    npm config set proxy=http://uname:pword@192.168.5.8:8080
    
    npm config set https-proxy=http://uname:pword@192.168.5.8:8080
    
    0 讨论(0)
  • 2020-11-29 15:22

    there is a simple way of deleting or removing the npm proxies.

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

    worked for me.

    -g was important as initially it was set with that option. You can check configurations set with :

    npm config list
    
    0 讨论(0)
  • 2020-11-29 15:24

    Well, I'm gonna leave this here because I was having a big trouble with NPM.

    I was trying to change a proxy setting using npm config set proxy "http://.../" and then running npm config get proxy. It was ALWAYS returning a wrong value, different from the one that I'd set.

    I found out that I had a .npmrc COMMITED on the project I was trying to run npm install and that this file was overriding my own config.

    So it was cleaning the proxy value, but I needed to also change the .npmrc inside the folder's project.

    After that, everything worked fine.

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

    See the npm Settings in file C:\Users\myusers.npmrc file. Sometime the npm proxy config settings does not apply. so its worth checking in there.

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

    In my case, (windows OS), after put all those commands listed, npm kept taking the proxy in the setting of windows registry

    \ HKEY_CURRENT_USER \ Environment

    just remove the proxy settings there, after that, I restarted the pc and then "npm install" worked for me

    Example

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