0

I am trying the npm install. But it is failing since I am behind a firewall. Is there any option that will let me specify proxy details along with npm install command.

I have seen the option npm config set proxy

But I am looking for something specific to npm install command

Ajith
  • 1,447
  • 2
  • 17
  • 31

2 Answers2

1

Try this one:

npm --proxy http://myusername:mypassword@proxy.us.somecompany:8080 \
--without-ssl --insecure -g install
Josem
  • 378
  • 7
  • 15
0
npm config set proxy http://proxy.company.com:8080 
npm config set https-proxy http://proxy.company.com:8080

Example: npm config set proxy http://10.50.225.222:3128 , npm config set https-proxy http://10.50.225.222:3128

  • I doubt that this helps - or even works at all. Please explain. – Yunnosch Aug 28 '20 at 10:11
  • @Yunnosch, it works if you are using proxy server, replace your proxy address and port you have to use both commands in order – Thilina Madushan Aug 28 '20 at 14:57
  • I am still not convinced. Would you like to edit and add an explanation how this works and why it solves the problem? Just writing that it works and how to do it does not convince me. – Yunnosch Aug 28 '20 at 15:01