Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
365 views
in Technique[技术] by (71.8m points)

node.js - npm install not work

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:Usersyy
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:Usersyy
pm-debug.log
npm ERR! not ok code 0

thanks in advance!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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/

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...