前提:我是用的是MAC系统,不知道使用windows系统是否也可以
react-box 项目构建
localhost:ReactDapp liyuechun$ truffle unbox react-boxStarting unbox...
=================✔ Preparing to download box
✖ Downloading
Unbox failed!
RequestError: Error: connect ECONNREFUSED 0.0.0.0:443at 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:189:13)at Request.onRequestError (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/request/request.js:881:1)at ClientRequest.emit (events.js:189:13)at TLSSocket.socketErrorListener (_http_client.js:392:9)at TLSSocket.emit (events.js:189:13)at emitErrorNT (internal/streams/destroy.js:82:8)at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)at process._tickCallback (internal/process/next_tick.js:63:19)
Truffle v5.1.29 (core: 5.1.29)
Node v10.15.3
解决办法
- 打开链接 请点我 ,下载
demo
,拷贝解压文件夹里面的hosts
文件 - 打开终端,输入
open /etc
- 将
hosts
粘贴到etc
文件夹,替换掉原来的hosts
文件。
localhost:ReactDapp liyuechun$ truffle unbox react-boxStarting unbox...
=================✔ Preparing to download box
✔ Downloading
✔ cleaning up temporary files
✔ Setting up boxUnbox successful, sweet!Commands:Compile: truffle compileMigrate: truffle migrateTest contracts: truffle testTest dapp: cd client && npm testRun dev server: cd client && npm run startBuild for production: cd client && npm run build
参考链接