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 } } }; 

3 Answers 3

5

Rename truffle-config.js to truffle.js.

1
  • 2
    Changing the filename did not work for me. Commented Dec 16, 2017 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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.