NPM安装无法正常工作NPM安装无法正常工作(npm install not work)

2019-05-12 02:34发布

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!

Answer 1:

它看起来像你使用了代理。 要通过通过它,你必须配置它,如:

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

以https问题解决了:

npm config set registry http://registry.npmjs.org/


文章来源: npm install not work
标签: node.js npm gulp