5

I am switching machines and ran into a weird issue with truffle. Truffle is set up properly on my old machine. I can compile and run tests without any issues. To my knowledge, I set up everything the same way on my new machine. All tests and source files were pulled from a repo, so I at least know my project directory is identical on both machines.

When I attempt to run tests on my new machine via truffle test, the console hangs for about ten seconds, then the terminal prompt reappears: benjamin@spectre-laptop:~/git/busd/ethereum$ truffle test benjamin@spectre-laptop:~/git/busd/ethereum$

I do not receive any output or errors. This also occurs with truffle deploy and truffle compile.

If I run truffle build, I see the following: benjamin@spectre-laptop:~/git/busd/ethereum$ truffle build No build configuration found. Preparing to compile contracts. benjamin@spectre-laptop:~/git/busd/ethereum$

Does anyone know what the issue is?

2
  • Check your Truffle version on each machine, and get back to us with your findings. Commented Feb 5, 2019 at 6:32
  • 5.0.2 on my old machine, 5.0.3 on my new one. Commented Feb 5, 2019 at 15:26

5 Answers 5

2

I was facing exactly the same error i had installed truffle before so when i checked the version..it was all compatible. But you need to do: npm i -g truffle add sudo in the beginning due to permissions. and the do truffle compile/migrate.

0
1

In my case, turned out running truffle compile didn't do anything because of some permission errors. Running it with sudo worked just fine

Use : sudo truffle compile

0

I was having the same problem. I would run the command truffle init and that would run fine. When I tried to run truffle test nothing would happen. No errors, no output, no timeout, just nothing. If I ran sudo truffle test it would work. In the end, I managed to get the tests to run by compiling for the first time. The commands I used where

truffle init
truffle compile
truffle test

I only needed to run the compile the very first time. After that everything worked and I could just run truffle test I have no idea why this worked, as the test command does a compile before running the tests.

Hope it helps someone else out.

0

For me, it was because I didn't have any networks defined in truffle-config.js

Once I explicitly added the development network, truffle test began to work.

module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",
      port: 7545,
      network_id: "*"
    }
  }
  // ...
}
0

Same for me using

sudo truffle test 

made everything work!

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.