This repository has been archived by the owner. It is now read-only.

Running NPM install behind a socks5 proxy #6204

Closed
benmarten opened this Issue Sep 17, 2014 · 8 comments

Comments

Projects
None yet
7 participants
@benmarten
Copy link

benmarten commented Sep 17, 2014

Hi,

how can I make npm install work behind a socks5 proxy?

@iarna iarna added the support label Sep 17, 2014

@iarna

This comment has been minimized.

Copy link
Member

iarna commented Sep 17, 2014

Unfortunately, npm has no native support for socks proxies. Work arounds include:

  1. Running an http proxy server that's socks aware and telling npm to use that.
  2. Using a tool like socksify to run npm.
@iarna

This comment has been minimized.

Copy link
Member

iarna commented Sep 17, 2014

On OSX: I'd use dsocks, on Linux tsocks. Windows I don't have a recommendation but googling for "socks wrapper" shows several alternatives.

@iarna iarna closed this Sep 17, 2014

@benmarten

This comment has been minimized.

Copy link
Author

benmarten commented Sep 17, 2014

Thanks iarna,
dsocks did not work for me... I now use ProxyCap. http://www.proxycap.com
Works great. It will manage the ssh tunnel + socks proxy and route all traffic automatically (also for npm) through it.

@hengyunabc

This comment has been minimized.

Copy link

hengyunabc commented Sep 28, 2015

tsocks can work:

DYLD_INSERT_LIBRARIES=/usr/local/lib/libtsocks.dylib npm install bower -g
@horaceho

This comment has been minimized.

Copy link

horaceho commented Nov 30, 2015

I use proxychains4 on OS X but it's usually good for simple modules. Complex modules, e.g. ionic, does not finish the whole installation.

Wish that npm can support socks5 proxy as simple as:

ALL_PROXY=socks5://127.0.0.1:5000 npm install ionic -g

which is supported by nvm:

ALL_PROXY=socks5://127.0.0.1:5000 nvm install v4.3.1
@JamesTheHacker

This comment has been minimized.

Copy link

JamesTheHacker commented Nov 10, 2016

After much frustration I found the use of polipo. I write an article setting it up: https://medium.com/@jamesjefferyuk/how-to-use-npm-behind-a-socks-proxy-c81d6f51dff8#.t1pdhr6x1

@lizhaode

This comment has been minimized.

Copy link

lizhaode commented Mar 14, 2017

@JamesTheHacker
Hi,
when I use polipo to proxy npm,the terminal throws these by polipo:

Couldn't establish listening socket: Too many open files

My system version is Mac OS X 10.11.6
Did you have this question?

@eddyloewen

This comment has been minimized.

Copy link

eddyloewen commented Sep 13, 2017

What if none of the other/previous tips are applicable? Will this ever be implemented or supported by npm itself?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.