Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NPM module installation error

I am getting Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND while trying to install a module in node.js. It seems some proxy error.I checked in browser setting ,proxy is disabled. But when i am checking in command prompt npm config get proxy, getting 192.168.98.5:8080. How to disable this?

like image 873
Tarak Avatar asked Mar 22 '13 11:03

Tarak


3 Answers

First, try to execute npm config delete proxy. If you get something like Error: ENOENT, unlink '/Users/drlazor/.npmrc' is OK; that means you don't have a npm config file and, therefore, no proxy settings.

Second, verify you have no proxy settings with npm config get proxy. You should get a nullor the above error. If you keep on getting a result different from null, you should also ensure you haven't set the environment variable HTTP_PROXY.

Third and last, if none of those worked, try accessing the URL from your browser; it could be a network issue after all.

like image 70
fibriZo raZiel Avatar answered Sep 22 '22 14:09

fibriZo raZiel


You should check the npm config page on how to set and modify config values. proxy key stores proxy server to use to connect to npm repositories. Try this :

npm config delete proxy
like image 36
user568109 Avatar answered Sep 19 '22 14:09

user568109


Note: This Works if you are not behind a Proxy i.e (From a Personal Computer)

First execute this command

npm config edit

npm the configuration file opens comment following two lines in the opened file by putting ";"(semi Colon) in start of the line.

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

You are done. Now install any package you want to.

npm install -g cordova
npm install -g npm

or anything else you need to install

like image 40
Noor Ul Islam Khattak Avatar answered Sep 21 '22 14:09

Noor Ul Islam Khattak