Im creating my dapp with following below tutorial. http://www.dappuniversity.com/articles/the-ultimate-ethereum-dapp-tutorial

however Im facing an error when I run

truffle console

it shows

>truffle console

Could not connect to your Ethereum client with the following parameters:
    - host       >
    - port       > 7545
    - network_id > *

Please check that your Ethereum client:
    - is running
    - is accepting RPC connections (i.e., "--rpc" option is used in geth)
    - is accessible over the network
    - is properly configured in your Truffle configuration file (truffle-config.js)

Truffle v5.0.17 (core: 5.0.16)
Node v10.15.3

I have tried

truffle init

but my command prompt got stacked after it showed

>truffle init

This directory is non-empty...
? Proceed anyway? Yes
- Preparing to download

can anyone please advise me what needed to be changed.

FYI the code inside truffle-config.js is

module.exports = {
  networks: {
    development: {
      host: "",
      port: 7545,
      network_id: "*" // Match any network id

Thank you

  • Check your question please. The error implies that truffle-config.js should state port: 7545, but instead it is stating port: 7574. So I'm guessing that one of these two is not exactly what you say it is. Commented May 15, 2019 at 13:44
  • Sorry typo! still facing same issue after changed to port: 7545
    – Trey
    Commented May 15, 2019 at 14:00
  • 1
    Well have you started an Ethereum node (e.g. Ganache) listening on Commented May 15, 2019 at 14:09
  • Thank you its working now. Shame on me.
    – Trey
    Commented May 15, 2019 at 14:16

9 Answers 9


Do truffle develop before doing truffle console


My problem was that I was using WSL2 to run my truffle commands and my ganache GUI is in windows. My fix configures WSL2 with the Windows ganache GUI

What I did was

  1. Restart my computer

  2. Specify vEthernet(WSL) as the ganache server enter image description here

  3. Copy the hostname for vEthernet(WSL) into my truffle.config file for the host field

    module.exports = {
      networks: {
        development: {
          host: "",
          port: 7545,
          network_id: "*"

Note: Your host for vEthernet(WSL) might differ from mine and differ each time you restart.


In case anyone else runs into this problem. For me it was because I forgot I was using WSL2 so the linux environment wasn't talking to Ganache running on windows.

So instead of wsl terminal, just open up a bash terminal on VSCode, reinstall truffle on windows npm i -g truffle and you should be good to go.


For me the problem was caused by my VPN. I disabled the VPN and immediately worked.


For those who may stumble across this: I was stuck on this recently - everything seemed to be set correctly but Truffle refused to connect to Ganache (or vice versa). I kept getting the "Could not connect to your Ethereum client" message. On a lark, I tried changing the host address in truffle.js to reflect the computer's actual internal IP address (e.g., and then telling Ganache to run on the Ethernet address instead of loopback. Much to my surprise, it worked immediately. I haven't yet figured out why (firewall rule? codebase issue?).

I realize this is not a best practice because your internal IP will change. But if you're in need of a temporary workaround, this may help.


Check that you have Ganache opened


My project was using port "8545" on my old machine but when I switched to a new machine, Ganache was running on port "7545" and config file was set to be "8545". SO changed the setting in config file.


For me the problem was I was running truffle migrate command on windows CMD. And the solution was, I opened a new terminal on VS Code, then typed truffle develop and then I typed truffle migrate and it worked.


In my case, I was calling the truffle console without starting the Ganache server. Before executing the truffle console. Start your Ganache server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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