27

I have searched some answers here and on google as well but none of them actually apply to my case.

I tried on console and power shell to run truffle migrate but I keep getting

could not find suitable configuration file

I saw that sometimes renaming the truffle-config.js is also an option but I just don't find this file on my computer even after running

npm install --force -g truffle

Any ideas of what could that be?

EAzevedo
  • 691
  • 1
  • 7
  • 11
  • it worked in my case. https://ethereum.stackexchange.com/questions/26012/is-it-possible-to-divide-my-crowdsale-contract-into-multiple-files-in-order-to-s – zono Sep 11 '17 at 10:05

5 Answers5

29

Very noob mistake from my part.

I have actually to initialize the project before migrating it.

truffle init

after that

truffle migrate

sorry.

EAzevedo
  • 691
  • 1
  • 7
  • 11
4

I had a similar issue. My problem was that my project (on the project root level) was missing a truffle.js file with the following contents:

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

related truffle documentation

after adding this file my desired truffle commands worked

matyas
  • 141
  • 4
1

I'm answering this question at a later date. I ran into the same issue, and in my case, none of the answers above was a solution for me. I made a silly mistake, and that was executing truffle console in the wrong directory.

My solution was to run truffle console in the directory containing truffle-config.js.

Hopefully, anyone running into a similar issue might find this helpful sometimes.

1

in my case I initialized truffle with "truffle init" in the same directory in which i was working and then every truffle command started working.

Bal Mukund
  • 11
  • 1
0

I also had the same problem but despite i had truffle-config file in root folder.

The problem that is was a truffle-config.ts not truffle-config.js.

Looks like truffle only works with JS config files. Anyway wish this might help anyone )