2

I installed truffle globally. I'm trying to connect truffle to a localhost

truffle console
> migrate

It failed with Unknown network "development". See your Truffle configuration file for available networks..

truffle.js and truffle-config.js ( why there are two files ? )

module.exports = {
  networks: {
    development: {
      host: "localhost",
      port: 9545,
      network_id: "*" // Match any network id
    }
  }
};
5

Rename truffle-config.js to truffle.js.

  • 2
    Changing the filename did not work for me. – Jazzmine Dec 16 '17 at 1:17
0

I notice you have port 9545. Was that intended? The default port is 8545 for testrpc.

Try confirming on which port you started your network and make sure it is still alive.

0

Try networks: { development: { host: "127.0.0.1", port: 7545, network_id: "*" // Match any network id }

This is the default truffle network.

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.