2

I'm trying to learn Nodejs, but every time I try installing modules from NodeSchool; specifically "how-to-node" & "learnyounode". I'm getting "ECONNREFUSED" when trying to run anything. Can anyone shed a little light as to why I keep getting this? BTW it happens if I run normally or sudo.

I'm assuming it's something to do with proxy settings, but I'm not sure how to fix it. From all the tutes I've read and videos I've watched I appear to be following the instructions correctly.

bu2@pdouxdbu2:~$ npm install -g how-to-node
npm ERR! Error: connect ECONNREFUSED
npm ERR!     at errnoException (net.js:905:11)
npm ERR!     at Object.afterConnect [as oncomplete] (net.js:896:19)
npm ERR!  { [Error: connect ECONNREFUSED]
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   syscall: 'connect' }
npm ERR! 
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly.  See: 'npm help config'

npm ERR! System Linux 3.11.0-26-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "how-to-node"
npm ERR! cwd /home/bu2
npm ERR! node -v v0.10.37
npm ERR! npm -v 1.4.28
npm ERR! syscall connect
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! stack Error: connect ECONNREFUSED
npm ERR! stack     at errnoException (net.js:905:11)
npm ERR! stack     at Object.afterConnect [as oncomplete] (net.js:896:19)
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/bu2/npm-debug.log
npm ERR! not ok code 0
bu2@pdouxdbu2:~$ sudo npm -g install how-to-node
[sudo] password for bu2: 
npm ERR! Error: connect ECONNREFUSED
npm ERR!     at errnoException (net.js:905:11)
npm ERR!     at Object.afterConnect [as oncomplete] (net.js:896:19)
npm ERR!  { [Error: connect ECONNREFUSED]
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   syscall: 'connect' }
npm ERR! 
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly.  See: 'npm help config'

npm ERR! System Linux 3.11.0-26-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "-g" "install" "how-to-node"
npm ERR! cwd /home/bu2
npm ERR! node -v v0.10.37
npm ERR! npm -v 1.4.28
npm ERR! syscall connect
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! stack Error: connect ECONNREFUSED
npm ERR! stack     at errnoException (net.js:905:11)
npm ERR! stack     at Object.afterConnect [as oncomplete] (net.js:896:19)
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/bu2/npm-debug.log
npm ERR! not ok code 0
bu2@pdouxdbu2:~$
lukeslytalker
  • 39
  • 1
  • 10
  • Can you access any other network resources? (e.g., in whatever machine or VM you're running NPM, can your browser get to `example.com`)? Are you in a corporate or academic environment that might require traffic to go through an institution-wide proxy? – apsillers Apr 27 '15 at 15:39
  • I am behind a corporate proxy. I thought there were some "proxy" commands I could use to get around this, but I keep getting the same errors. Any ideas? – lukeslytalker Apr 27 '15 at 15:54
  • Possibly a duplicate of [Is there a way to make npm install (the command) to work behind proxy?](http://stackoverflow.com/a/10304317), if that solves your problem. – apsillers Apr 27 '15 at 16:00
  • 1
    possible duplicate of [Is there a way to make npm install (the command) to work behind proxy?](http://stackoverflow.com/questions/7559648/is-there-a-way-to-make-npm-install-the-command-to-work-behind-proxy) – mbcrute Apr 27 '15 at 16:31
  • 1
    I also had the same problem. I was able to fix it. Please follow http://stackoverflow.com/questions/24244684/npm-install-not-work . – kumar649 May 02 '16 at 10:03
  • Thanks @kumar649 that worked. Thanks for posting here. Cheers. – lukeslytalker Nov 07 '16 at 19:19
  • Possible duplicate of [NPM Install not working with artifactory around proxy](http://stackoverflow.com/questions/24499243/npm-install-not-working-with-artifactory-around-proxy) – Abhishek Menon Apr 12 '17 at 05:51
  • set proxy is not working . can someone help me how fix above issuse. its corporate environment. – Arul Sidthan Sep 04 '17 at 07:09
  • Possible duplicate of [npm install not work](https://stackoverflow.com/questions/24244684/npm-install-not-work) – apokryfos Jan 30 '18 at 07:53

1 Answers1

-1

npm config set proxy http://:proxyaddress:portnumber npm config set https-proxy http://proxyaddress:portnumber first run these two commands and then install. it works.

Aadhii
  • 51
  • 2
  • 3
  • 8