truffle init问题解决
转:https://blog.csdn.net/qq_32760017/article/details/83480284
首先Truffle是针对基于以太坊的Solidity语言的一套开发框架。
在Mac OS执行truffle init
报错:
Starting unbox... ================= ? Preparing to download box ? Downloading Unbox failed! ? Downloading Unbox failed! RequestError: Error: connect ECONNREFUSED 0.0.0.0:443 at new RequestError (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/request-promise-core/lib/errors.js:14:1) at Request.plumbing.callback (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/request-promise-core/lib/plumbing.js:87:1) at Request.RP$callback [as _callback] (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/request-promise-core/lib/plumbing.js:46:1) at self.callback (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/request/request.js:185:1) at Request.emit (events.js:315:20) at Request.onRequestError (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/request/request.js:881:1) at ClientRequest.emit (events.js:315:20) at TLSSocket.socketErrorListener (_http_client.js:432:9) at TLSSocket.emit (events.js:315:20) at emitErrorNT (internal/streams/destroy.js:84:8) at processTicksAndRejections (internal/process/task_queues.js:84:21) Truffle v5.1.23 (core: 5.1.23) Node v13.12.0
上网查了很多资料说法不一,有的说修改hosts文件的映射,有的也说可能是防火墙没关闭,都尝试了下还是不能解决。最终在 原文找到了解决方法。
解决方案如下:
使用google hosts文件替换本地的hosts文件即可。
然后执行truffle init
成功,如下图所示:
相关推荐
boneix 2020-10-21
seanzed 2020-10-15
ifconfig 2020-10-14
学留痕 2020-09-20
往后余生 2020-09-17
kka 2020-09-14
redis 2020-09-07
lzccheng 2020-09-06
soyo 2020-08-31
stonerkuang 2020-08-18
LxyPython 2020-08-17
raksmart0 2020-08-17
Lzs 2020-08-14
MrHaoNan 2020-07-31
80530895 2020-07-05
lengyu0 2020-06-28
YarnSup 2020-06-28
huanglianhuabj00 2020-06-27