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?