0

I'm trying to install truffle on node version 8.9.0 but it shows it has been installed and when I try to do anything on that, throws this error.

C:\Users\com\AppData\Roaming\nvm\v8.9.0\node_modules\truffle\build\282.bundled.js:64897
  } catch {
          ^

SyntaxError: Unexpected token {
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:599:28)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.__webpack_require__.f.require (C:\Users\com\AppData\Roaming\nvm\v8.9.0\node_modules\truffle\build\cli.bundled.js:611:28)

I'm stuck on this for a while so please help me asap.

1 Answer 1

0

Try to use different node version. You can install and use a new version by saying:

nvm install 12.20.2
nvm use 12.20.2

And then check if the correct version is being used with nvm list. You should see something like this:

  * 12.20.2 (Currently using 64-bit executable)
    8.9.0

I hope this helps.

1
  • Thank You very much, you are my savior. I was struggling with it for so long...... Apr 27, 2022 at 18:39

Your Answer

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

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