I just tried to install truffle using npm. I followed the documentation and did npm -g install truffle

However, after that, when I try to do anything (such as just run truffle or truffle --version), I get the error

  } catch {

SyntaxError: Unexpected token {
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.__webpack_require__.f.require (/home/jonathan/.npm-global/lib/node_modules/truffle/build/cli.bundled.js:613:28)

my npm version is 6.14.8, nodejs version 8.10.0. running which truffle gives


I am at a complete loss, does anyone know how to fix this? Im also quite the beginner when using npm, only use it for ethereum related things.

1 Answer 1


I had this issue as well, the problem is the nodejs version. Updating to v15.11.0 and reinstalling Truffle should fix it.

  • Former Truffle team member here - this is likely correct. Node 8 is super old. Also if you're not using NVM or one of its sister projects to manage your node versions, I highly recommend it. github.com/nvm-sh/nvm
    – Ben Burns
    Commented Dec 7, 2021 at 2:36

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.