I'm a bit new here and I've been trying to migrate truffle however I keep running into this error: Error: The network id specified in the truffle config (5777) does not match the one returned by the network (1). Ensure that both the network and the provider are properly configured.

I've tried to specify the network in truffle-config.js file although that hasn't worked. It currently looks like this:

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

Trying to run ganache forked and haven't been able to change networkId from 1. Cannot for the life of me find the issue, any help would be greatly appreciated. :)

  • How do you run ganache?
    – matank001
    Oct 22, 2022 at 15:37
  • I've been running it through terminal with command: ganache -f -m <Mnemonic phrase> -u <user> -p 7545
    – Madds
    Oct 25, 2022 at 1:27

1 Answer 1


Try running ganache with:

--networkId 5777

  • Unknown argument: chainId is returned.
    – Madds
    Oct 25, 2022 at 23:40
  • @Madds edited, I wrote to ganache-cli
    – matank001
    Oct 26, 2022 at 4:50
  • Even running ganache with --networkId 5777 I get a Network ID: 1 returned on the forked chain.
    – Madds
    Oct 31, 2022 at 1:43

Your Answer

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

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