Getting error when trying to run Ganache (forking BSC chain)

239 views Asked by At

I have installed Ganache following instructions from https://github.com/trufflesuite/ganache#documentation

I am trying to fork BSC chain for which I have a node running locally which is fully synced (I want to fork this for which I have provided the URL in package.json under scripts).

When trying to run Ganache using npm run ganache it is giving me this error. Any idea how can I solve this?

SyntaxError: Unexpected token '?'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.__webpack_require__.f.require (/usr/local/lib/node_modules/ganache/dist/node/cli.js:2:21481)
    at /usr/local/lib/node_modules/ganache/dist/node/cli.js:2:20777
    at Array.reduce (<anonymous>)`

Supposedly it was supposed to run after this, so why i am getting this error?

1

There are 1 answers

0
Marc On BEST ANSWER

Check your Node.js version:

node -v
v18.13.0

Version must be >= v14.0.0. After updating to the latest Node.js version, the error no longer occurred for me.