For npm 11.6.4's package fetcher, use socks5h when the proxy should resolve destination names and socks5 for local resolution. That release's bundled socks-proxy-agent makes this distinction.

Save an existing SOCKS5 endpoint in user configuration:

npm config set proxy socks5h://127.0.0.1:1080 --location=user
npm config set https-proxy socks5h://127.0.0.1:1080 --location=user

For an allowed public-registry download without proxy authentication, a SOCKS5 proxy list entry can replace the illustrative local listener in both URLs. Both destination settings can name the same endpoint. Proxy-side resolution is useful when the target name exists only in that network's DNS view.

The supported path runs from npm-registry-fetch through make-fetch-happen to @npmcli/agent, which selects SocksProxyAgent. This package-fetch path needs no HTTP-to-SOCKS adapter.

Check which npm the command or IDE runs before adopting it. Older releases used other fetch implementations; support in 11.6.4 does not establish every earlier version's behavior.

Erthyglow kevrennek