Asked 7 years ago
3 Nov 2017
Views 2732
shabi

shabi posted

how to remove proxy for npm at mac

trying to install react-native in mac

sudo npm install -g react-native-cli

and instead of react-native install . i got following error

npm ERR! Darwin 15.6.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-save-exactly" "react-native-cli"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo

npm ERR! network getaddrinfo ENOTFOUND example.com
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/example/Library/Caches/Homebrew/npm-debug.log


so it is saying some pc behind proxy and that causing problem to install react-native

so i try to check it

npm config list 


so i got

; cli configs
user-agent = "npm/2.7.4 node/v0.12.2 darwin x64"

; userconfig /Users/example/.npmrc
https-proxy = "http://example.com/"
proxy = "http://example.com/"
registry = "http://registry.npmjs.org/"

; node bin location = /usr/local/bin/node
; cwd = /Users/example/Library/Caches/Homebrew
; HOME = /Users/example
; 'npm config ls -l' to show all defaults.


so how to remove proxy for npm at mac ?
Mitul Dabhi

Mitul Dabhi
answered Nov 30 '-1 00:00

remove proxy by npm config rm

npm config rm proxy 
npm config rm https-proxy
Post Answer