npm安装forever 报错:npm ERR! network 'proxy' config is set properly. See: 'npm help config'

 # 安装:
npm install forever -g

报错,错误信息如下,

npm WARN optional dep failed, continuing fsevents@1.2.9
npm ERR! Linux 3.10.0-229.el7.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "forever"
npm ERR! node v4.2.2
npm ERR! npm  v2.14.7
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! syscall read

npm ERR! network read ECONNRESET
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
npm ERR! Linux 3.10.0-229.el7.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "forever"
npm ERR! node v4.2.2
npm ERR! npm  v2.14.7
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! syscall read

npm ERR! network read ECONNRESET
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

一开始以为是node的版本问题,后台才发现是,国内由于gfw问题,导致很多国外的网站不能访问,比如bitbucket就是一个host代码的很优秀平台,但是由于该平台可能被block住,从而导致npm安装时出现奇奇怪怪的问题,

于是我尝试使用proxy来代理访问:
npm config set registry https://registry.npm.taobao.org 

然后在执行:
npm install forever -g

安装成功:

npm WARN optional dep failed, continuing fsevents@1.2.9
npm WARN engine atob@2.1.2: wanted: {"node":">= 4.5.0"} (current: {"node":"4.2.2","npm":"2.14.7"})
/usr/local/bin/forever -> /usr/local/lib/node_modules/forever/bin/forever
forever@1.0.0 /usr/local/lib/node_modules/forever
├── path-is-absolute@1.0.1
├── object-assign@3.0.0
├── async@0.2.10
├── clone@1.0.4
├── colors@0.6.2
├── mkdirp@0.5.1 (minimist@0.0.8)
├── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)
├── cliff@0.1.10 (eyes@0.1.8, colors@1.0.3)
├── prettyjson@1.2.1 (minimist@1.2.0, colors@1.3.3)
├── nssocket@0.5.3 (eventemitter2@0.4.14, lazy@1.0.11)
├── winston@0.8.3 (cycle@1.0.3, stack-trace@0.0.10, eyes@0.1.8, isstream@0.1.2, pkginfo@0.3.1)
├── nconf@0.6.9 (ini@1.3.5, async@0.2.9, optimist@0.6.0)
├── utile@0.3.0 (deep-equal@0.2.2, async@0.9.2, i@0.3.6, ncp@1.0.1, rimraf@2.6.3)
├── shush@1.0.0 (strip-json-comments@0.1.3, caller@0.0.1)
├── flatiron@0.4.3 (director@1.2.7, optimist@0.6.0, prompt@0.2.14, broadway@0.3.6)
└── forever-monitor@1.7.1 (minimatch@3.0.4, utile@0.2.1, ps-tree@0.0.3, broadway@0.3.6, chokidar@1.7.0)

 

 

  • 25
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值