0

When I successfully compiled and deployed contracts using Truffle and ganache-cli, I typed truffle develop to get into the truffle(develop)>, and then typed let instance = await Factory.deployed(), it then showed Uncaught Error: CONNECTION ERROR: Couldn't connect to node http://127.0.0.1:9545/. But actually I have opened the new ganache-cli by the command ganache-cli -p 9545 (successfully run and showed Listening on 127.0.0.1:9545) before that.

Why this happened and what can I do?

  • You don't need to open both truffle develop and ganache-cli, most certainly when they are both configured to listen on the same port number. – goodvibration Jul 23 '20 at 7:25
  • However, after I successfully deploy contracts, I typed truffle develop and got into the truffle(develop)>, and then typed let instance = await Factory.deployed(), it then still showed Uncaught Error: CONNECTION ERROR: Couldn't connect to node http://127.0.0.1:9545/. Though I didn't open the new window to typed ganache-cli -p 9545, though I closed the only one ganache-cli (ganache-cli --allowUnlimitedContractSize for deploying contracts) and then typed let instance = await Factory.deployed(), it still showed that. – xxs Jul 23 '20 at 7:42
  • After starting the `Truffle' check port (by default 7545). – MentatX Jul 23 '20 at 8:01

Your Answer

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

Browse other questions tagged or ask your own question.