前提:我是用的是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
參考鏈接