Failed at the bitcore-node@3.1.3 preinstall script './scripts/download' 设置linux proxy (代理)的方式

此问题发生的条件是:

用bitcore官方提供的方式在linux进行npm安装,报错:

Downloading bitcoin: https://github.com/bitpay/bitcoin/releases/download/v0.12.1-bitcore-4/
npm ERR! Linux 3.16.0-4-686-pae
npm ERR! argv "/home/user/.nvm/versions/node/v4.6.0/bin/node" "/home/user/.nvm/versions/node/v4.6.0/bin/npm" "install" "-g" "bitcore"
npm ERR! node v4.6.0
npm ERR! npm v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! bitcore-node@3.1.3 preinstall: ./scripts/download
npm ERR! Exit status 22
npm ERR!
npm ERR! Failed at the bitcore-node@3.1.3 preinstall script './scripts/download'.
npm ERR! This is most likely a problem with the bitcore-node package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./scripts/download
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bitcore-node
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls bitcore-node
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/user/npm-debug.log

此后更换了各种npm源,都不能解决。大家都知道中国的墙很高,所以FQ,但是在linux下配vpn的方法比较复杂,所以我在自己的一台设置好vpn的电脑上安装了CCProxy,作为linux的代理,然后在linux下设置npm proxy:

npm config set proxy http://server:port
npm config set https-proxy http://server:port
npm 取消代理: npm config delete proxy 
设置之后可以用:npm config ls 查看设置的npm源和proxy是不是自己想要的。
设置之后,可以在ccproxy看到连接信息,但是依然不能下载。
后来进一步发现是在Downloading bitcoin: https://github.com/bitpay/bitcoin/releases/download/v0.12.1-bitcore-4/出的错,而这样的download一般用的是curl的方式,所以设置了npm代理并不能解决curl的问题。
随后我设置了全局的proxy,在~.bashrc最后添加如下指令:
export http_proxy=http://server:port"
export https_proxy="http://server:port"
export ftp_proxy="http://server:port"
然后运行source ~/.bashrc让配置生效,应该可以了吧,但是结果依然是no。
问题在哪?因为我运行source ~/.bashrc命令的地方不对,据说这个命令只对当前的seesion有效,所以得在安装bitcore的界面使用,结果证明确实是这个问题。
 
然而,还有一个问题:
当我安装好bitcore之后,又安装了bws和insight,结果发现bws 和insight之间的通讯怎么都不对,但是单独对bws和insight进行测试,都是可以的。
后来发现是proxy的问题,因为我之前设置proxy,所以数据都在往我另一台电脑上发。
所以在使用了proxy之后,记得重置:unset http_proxy 以及另外两个,血泪教训啊。
 

 

 
 
 
 

 

posted @ 2017-02-26 10:57  三尺剑  阅读(1668)  评论(0编辑  收藏  举报