Ganache not liking truffle-config.js :(

So I am following the Ethereum Smart Contract Programming 201 video: “Deploying our first contract”. And at the 5:24 minute mark Filip adds truffle-config.js to Ganache.

I tried doing this, however, no contracts show up in the Contracts section in Ganache, instead it says the following: " To see rich contract data compile the contracts within your Truffle Project."

If I go to the workspace settings by clicking on the cog, under Project Settings it says the following:

"An error occurred while running /home/nick/BlockchainBootcamp/Week7/truffle-hellow-world2/truffle-config.js! Did you forget to `npm install` your project?HIDE STACK TRACE
/tmp/ganache2021627-12067-8j1kxz.htyqe/index.js:9
  );
  ^
SyntaxError: Unexpected token )
    at Object.exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:418:7)
    at startup (bootstrap_node.js:139:9)
    at bootstrap_node.js:533:3"

Please advise, I need to finish the course ASAP and am stuck because of this error.

Hi @CryptoBuddha

That seems to be a syntax error.
Push your code to github and share the repo so that we can reproduce locally.

Thanks,
Dani

Here you go: https://github.com/CryptoBuddha/HelloWorldContractETH201

I am able to deploy your contract successfully.
Update truffle and retry:

  • Mac: sudo npm i -g truffle
  • Win: Open terminal as admin then npm i -g truffle
1 Like

Hey Dani, sorry for the delay in responding…

It is actually before deploying that the problem happens, I run

truffle migrate

and still get the same issue as above, even after installing truffle again. Please advise, this whole thing is a huge headache :frowning:

BTW, Filip said to use a specific version of truffle? Should we not do this?

Have you tried to run the command above to update truffle?
Run truffle --version and write it here.

Thanks
Dani