6

I have a problem that suddenly appeared, and now I get it every time that I try to run truffle test or truffle migrate, regardless of which project it is. I've even tried fetching the Petshop from the truffle docs (http://truffleframework.com/tutorials/pet-shop), and I still get the same error:

   mybox@c:~/code/petshop (master)$ truffle test
Using network 'development'.

Error: Don't set config.from directly. Instead, set config.networks and then config.networks[<network name>].from
    at Config.set [as from] (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:3019:15)
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:320066:21
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)

It seems like it protests that I'm using the old syntax for setting from, wanting me to do it for each network. However, this is done in the truffle.js file of all of the projects. It almost seems as there is some kind of global config that overrides the local somewhere, but I have no idea where.

I've tried reinstalling and downgrading truffle, to no avail.

Versions:

  • Node v9.4.0
  • Truffle 4.0.1
  • 1
    I've seen this same error using parity as the client - and this is confirmed by ethereum.stackexchange.com/questions/28998/…. I have no solution (other than using testrpc). Are you using parity? – gellej Jan 24 '18 at 15:35
  • I wasn't aware that parity was running - however, ps aux | grep parity told me otherwise. Stopping parity magically makes the tests run again, for some reason. Can you please post your comment as an answer so that I can award the bounty? – karianneberg Jan 24 '18 at 18:37
1
+50

I've seen this same error using parity as the client - and this is confirmed by Truffle error "Don't set config.from directly"….

I have no solution though, other than using testrpc

1

Met the same issue and solved it with following steps in geth: 1, eth.accounts replies null

2, personal.newAccount()

3, personal.unlockAccount(eth.accounts[0])

0

My guess would be either your error comes from the your migrations/deploy scripts, either it comes from your truffle-config file.

Could you provide some code of those in order we can get more into details ?

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.