开发者社区> 问答> 正文

用npm install 的时候每次都报错?报错

 zhongyudeAir:~ zhongyu$ npm install webpack -g
npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "webpack" "-g"
npm ERR! node v6.2.0
npm ERR! npm  v3.8.9
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! syscall connect

npm ERR! Error: connect ECONNREFUSED 127.0.0.1:8087
npm ERR!     at Object.exports._errnoException (util.js:953:11)
npm ERR!     at exports._exceptionWithHostPort (util.js:976:20)
npm ERR!     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)
npm ERR!  { Error: connect ECONNREFUSED 127.0.0.1:8087
npm ERR!     at Object.exports._errnoException (util.js:953:11)
npm ERR!     at exports._exceptionWithHostPort (util.js:976:20)
npm ERR!     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   syscall: 'connect',
npm ERR!   address: '127.0.0.1',
npm ERR!   port: 8087 }
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! Please include the following file with any support request:
npm ERR!     /Users/zhongyu/npm-debug.log 
<p></p>
<p>
	求大神帮帮忙
</p>

展开
收起
爱吃鱼的程序员 2020-06-08 20:14:56 1296 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
    试试: npmconfig set proxy null

    http://stackoverflow.com/questions/6278969/npm-cannot-work-error-econnrefused-could-not-contact-dns-servers

    npm可以设置使用taobao的镜像,速度快些

    谢谢你,这句话把我的问题解决了。好的谢谢我试试 #先全局安装nrmnpminstall-gnrm--registry=https://registry.npm.taobao.org#查看可用的npm镜像nrmls#使用淘宝的镜像nrmusetaobao#然后愉快的使用npm



    好的谢谢我试试。
    2020-06-08 20:15:12
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
基于webpack和npm的前端组件化实践 立即下载
基于FAAS构建NPM同步CDN 立即下载
低代码开发师(初级)实战教程 立即下载

相关镜像