0

I'm trying out the buidler suite using scaffold-eth. I can start up using yarn start fine, but when I run yarn run chain I get the following error:

Error: listen EADDRINUSE: address already in use 127.0.0.1:8545
    at Server.setupListenHandle [as_listen_2] (net.js:1309:16)
    at listenInCluster (net.js:1357:12)
    at GetAddrInfoReqWrap.doListen (net.js:1496:7)
    at GetAddrInfoReqWrap.onLookup [as oncomplete] (dns.js:69:10)
error Command failed with exit code 1

Looking at yarn run chain in the package.json yields that it moves in to the buidler directory and executes npx buidler node. A cursory look at the error looks like buidler defaults to port 8545, but that port is indeed already in use on my machine.

The answer should be simple enough - I just need to have buidler launch the dev chain on a different port. I've looked through the docs, though, and I'm not finding anything.

How do I tell buidler to use a different port?

1

You can check by running npx buidler node --help:

$ npx buidler node --help                                                              

Usage: buidler [GLOBAL OPTIONS] node [--hostname <STRING>] [--port <INT>]              

OPTIONS:                                                                               

  --hostname    The host to which to bind to for new connections (default: "localhost")
  --port        The port on which to listen for new connections (default: 8545)        

node: Starts a JSON-RPC server on top of Buidler EVM                                   

For global options help run: buidler help                                              

As expected, you can just pass a port using --port <your-port>.

1
  • 1
    I could've sworn I tried --port. Oh well. Thanks! – The Renaissance Jun 14 '20 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.