windows中truffle unbox react失败总结

学习自:https://blog.csdn.net/CHYabc123456hh/article/details/107736640
今天进行truffle unbox react创建空项目工程总是失败,查阅了相关博主的解决方法后成功解决了问题,上错误消息:

× Downloading Unbox failed! × Downloading Unbox failed! RequestError: Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Host: raw.githubusercontent.com. is not in the cert's altnames: DNS:default.ssl.fastly.net, DNS:fastly.com, DNS:*.a. ssl.fastly.net, DNS:*.hosts.fastly.net, DNS:*.global.ssl.fastly.net, DNS:*.fastly.com, DNS:a.ssl.fastly.net, DNS:purge.fastly.net, DNS:mirrors.fastly.net, DNS:control.fastly.net, DNS:tools.fastly.net at new RequestError (C:\Users\Administrator\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\request-promise-core\lib\errors.js:14:1) at Request.plumbing.callback (C:\Users\Administrator\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\request-promise-core\lib\plumbing.js:87:1) at Request.RP$callback [as _callback] (C:\Users\Administrator\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\request-promise-core\lib\plumbing.js:46:1) at self.callback (C:\Users\Administrator\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\request\request.js:185:1) at Request.emit (events.js:315:20) at Request.onRequestError (C:\Users\Administrator\AppData\Roaming\npm\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:426:9) at TLSSocket.emit (events.js:315:20) at emitErrorNT (internal/streams/destroy.js:92:8) at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) at processTicksAndRejections (internal/process/task_queues.js:84:21) Truffle v5.1.41 (core: 5.1.41) Node v12.18.3

【windows中truffle unbox react失败总结】发现需要修改host文件配置,分享该hosts文件,将其放于C:\Windows\System32\drivers\etc中覆盖原有hosts文件就ok了,下附hosts文件。
https://pan.baidu.com/s/11jwivgE1uz-5GgkVHGmhHg
提取码:r5sb
覆盖后成功安装
? Proceed anyway? Yes √ Preparing to download box √ Downloading √ Cleaning up temporary files √ Setting up boxUnbox successful, sweet!Commands:Compile:truffle compile Migrate:truffle migrate Test contracts:truffle test Test dapp:cd client && npm test Run dev server:cd client && npm run start Build for production: cd client && npm run build

    推荐阅读