Error: getaddrinfo ENOENT raw.githubusercontent.com

/ 0评 / 2

执行命令:

truffle unbox metacoin

报错连接不上 raw.githubusercontent.com

Starting unbox...
=================

√ Preparing to download box
× Downloading
Unbox failed!
× Downloading
Unbox failed!
RequestError: Error: getaddrinfo ENOENT raw.githubusercontent.com
    at new RequestError (D:\Program Files (x86)\node-v12.13.1-win-x64\node_modules\truffle\build\webpack:\node_modules\request-promise-core\lib\errors.js:14:1)
    at Request.plumbing.callback (D:\Program Files (x86)\node-v12.13.1-win-x64\node_modules\truffle\build\webpack:\node_modules\request-promise-core\lib\plumbing.js:87:1)
    at Request.RP$callback [as _callback] (D:\Program Files (x86)\node-v12.13.1-win-x64\node_modules\truffle\build\webpack:\node_modules\request-promise-core\lib\plumbing.js:46:1)
    at self.callback (D:\Program Files (x86)\node-v12.13.1-win-x64\node_modules\truffle\build\webpack:\node_modules\request\request.js:185:1)
    at Request.emit (events.js:210:5)
    at Request.onRequestError (D:\Program Files (x86)\node-v12.13.1-win-x64\node_modules\truffle\build\webpack:\node_modules\request\request.js:881:1)
    at ClientRequest.emit (events.js:210:5)
    at TLSSocket.socketErrorListener (_http_client.js:406:9)
    at TLSSocket.emit (events.js:210:5)
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Truffle v5.1.42 (core: 5.1.42)
Node v12.13.1

挂着梯子开全局还是不行。

解决方案:

在 C:\Windows\System32\drivers\etc\hosts中加入:

199.232.68.133  raw.githubusercontent.com

最好还是先确定一下raw.githubusercontent.com的ip地址 可以通过 https://www.ipaddress.com 这个网址查询

保存之后就可以了:

truffle unbox metacoin



Starting unbox...
=================

√ Preparing to download box
√ Downloading
√ Cleaning up temporary files
√ Setting up box

Unbox successful, sweet!

Commands:

  Compile contracts: truffle compile
  Migrate contracts: truffle migrate
  Test contracts:    truffle test

发表评论

电子邮件地址不会被公开。 必填项已用*标注