Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Node.js npm command to work behind corporate proxy

Tags:

node.js

npm

I am trying to install bower

npm install -g bower

but am getting an authentication error from our proxy

... npm http 407 http://registry.npmjs.org/bower ... Error Code: 407 Proxy Authentication Required. ...

I am trying to get npm working behind a corprate proxy. I think our proxy is a little weird because the only way I was able to get maven downloading packages was to add wagon-http-lightweight.jar as a maven extension.

http://maven.apache.org/wagon/wagon-providers/wagon-http-lightweight/

I have tried all the regular things as described here: Is there a way to make npm install (the command) to work behind proxy?

(I don't need to supply authentication details in my maven proxy settings).

npm config set registry http://registry.npmjs.org/ npm config set proxy http://myusername:[email protected]:8080 npm config set https-proxy http://myusername:[email protected]:8080 npm config set strict-ssl false

What else can I try?

like image 767
jax Avatar asked Nov 06 '13 22:11

jax


People also ask

How do I know if npm proxy is working?

To check if npm works with your settings you can use npm ping command from the command line. If it returns {} everything should be fine.

What is npm proxy?

Central registry: an npm proxy acts as a central registry for all your required package versions.


1 Answers

Can try this....working for me.

  • Open IE (Chrome did not work for me).
  • Hit the URL http://registry.npmjs.org
  • it will download json output if successful.

Now go back to command prompt and try npm install.

like image 93
hbthanki Avatar answered Oct 17 '22 17:10

hbthanki