1

The project is working on a Mac. Cloned from git on an Ubuntu machine while running truffle migrate it fails with: Error: Could not find artifacts for ./mycontract from any sources. Contract file of course exists, and code is working on the other box. What am I missing?

1 Answer 1

5

Try this: artifacts.require('MyContract').

Don't use the file name of the contract, use actual the name of the contract. artifacts.require uses the JSON files in [project root]/build/contracts, which are named after the contract's name, not it's file's name

1
  • great! it works, it will be nice to know why it does anyway on mac ... May 16, 2018 at 11:02

Your Answer

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

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