Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install not work

Tags:

node.js

npm

gulp

OS windows 7 64bit

when I use npm install gulp,npm does not work.

I am very confused....

Error code:

npm ERR! Error: connect ECONNREFUSED
npm ERR!     at errnoException (net.js:878:11)
npm ERR!     at Object.afterConnect [as oncomplete] (net.js:869: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 Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "nodemailer"
npm ERR! cwd C:\Users\yy
npm ERR! node -v v0.10.2
npm ERR! npm -v 1.2.15
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:878:11)
npm ERR! stack     at Object.afterConnect [as oncomplete] (net.js:869:19)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\yy\npm-debug.log
npm ERR! not ok code 0

thanks in advance!

like image 654
Janily Avatar asked Jun 16 '14 13:06

Janily


People also ask

Why npm install not working?

The Npm command not found error can appear when you install or upgrade npm. On Windows, the cause of this error could be that a PATH or system variable is not correctly set. The error can also occur if you do not have npm or Node. js installed, have an outdated version, or have permission issues.

How do you get npm install working?

Algorithm that makes the work of npm install easy : Check if node_modules folder exist or package-lock. json and trace the existing the dependency tree (folder structure) in it and clone the tree (or create a empty tree). Fetch the relevant dependencies (dev, prod or direct dependencies) from the package.

Why npm is not recognized?

> npm --version 'npm' is not recognized as an internal or external command, operable program or batch file. The error above happens when the Windows operating system doesn't know what to do with the npm command. To fix the error, you need to make sure that the Node executable file is available under your PATH setting.


1 Answers

It looks like you are behind a proxy. To by pass it, you have to configure it like :

npm config set proxy http://myproxyblabla:myport
npm config set https-proxy http://myproxyblabla:myport

Problems with https are solved with :

npm config set registry http://registry.npmjs.org/
like image 79
benek Avatar answered Sep 21 '22 13:09

benek