Skip to content

Instantly share code, notes, and snippets.

@JeremyNevill
Created February 6, 2017 16:23
Show Gist options
  • Select an option

  • Save JeremyNevill/3b8f1c2742588c402729f05b0bf3ca60 to your computer and use it in GitHub Desktop.

Select an option

Save JeremyNevill/3b8f1c2742588c402729f05b0bf3ca60 to your computer and use it in GitHub Desktop.
Configure Windows Npm Proxy
# Configure Windows Npm Proxy
# ===========================
# Including custom registry and proxy url/port
# Note: Will pop up the npm config window to see the mods when it runs
$ProxyUrlPort="YourProxyUrl:YourProxyPort"
$CustomRegistry="http://YourCustomRegistySuchAsArtifactory/api/npm"
function Configure-Windows-Npm-Proxy{
& npm config set registry $CustomRegistry
& npm config set "export http-proxy" "http://$ProxyUrlPort"
& npm config set "export https-proxy" "http://$ProxyUrlPort"
}
Configure-Windows-Npm-Proxy
npm config edit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment