0
votes

truffle migrate --compile-all --reset --network ganache

Compiling your contracts...

Everything is up to date, there is nothing to compile.

Unknown network "ganache". See your Truffle configuration file for available networks.

1
Can you include the config? - Ming

1 Answers

0
votes

By default you don't need to specify the --network, truffle will automatically connect to Ganache. On the other hand, if you want to have the name ganache configured as a network, you will have to modify your truffle-config.js file as follows:

networks: {
    //...,
    ganache: {
        host: "127.0.0.1",     
        port: YOUR_GANACHE_PORT,                       // (default: 5777)
        network_id: "YOUR_GANACHE_NETWORK_ID",         // (default: *)
    },
    //...
}

Check this picture to see Ganache port and network_id