Ganache-cli: Node 14 ganache-cli Error: Callback was already called.

Created on 25 Apr 2020  路  10Comments  路  Source: trufflesuite/ganache-cli

When I use node version 14, ganache exits with Callback was already called error.

Expected Behavior

$ ganache-cli
Ganache CLI v6.9.1 (ganache-core: 2.10.2)

Available Accounts
==================
(0) 0x73A3f3311c81971D7b19731f343D70cf7fB29B19 (100 ETH)
(1) 0x1d87DB423ce8169d6785c7712df1A71f1ec5D497 (100 ETH)
(2) 0xe003A29E017670348878714cA55fDb495e964339 (100 ETH)
(3) 0x0857e7dDD4E7f68130edf37e54Df723657376d91 (100 ETH)
...

Current Behavior

$ nvm use 14
$ npm install -g ganache-cli
$ ganache-cli
Ganache CLI v6.9.1 (ganache-core: 2.10.2)
Error: Callback was already called.
    at /home/~/.nvm/versions/node/v14.0.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:17:276
    at s.<anonymous> (/home/~/.nvm/versions/node/v14.0.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:17:2238)
    at s.emit (events.js:315:20)
    at s.destroy (/home/~/.nvm/versions/node/v14.0.0/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:37:712589)
    at finish (_stream_writable.js:681:14)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

Possible Solution

Steps to Reproduce (for bugs)

  1. $ nvm use 14
  2. $ npm install -g ganache-cli
  3. $ ganache-cli

Context

Failed to run a docker based custom test environment, because the docker image node:alpine was using node version 14.

Your Environment

  • Version used: v6.9.1
  • Version of Truffle/Remix/Other tools used: v5.1.23
  • NodeJS Version: v14.0.0
  • Operating System and version (include distro if Linux): Docker node:alpine / Ubuntu 20.04
  • Link to your project or repro gist: github.com/wanseob/zkopru
  • Commit hash to use with above link for reproduction:
  • I intend to submit a pull request to fix this issue: [ ]

bug

Most helpful comment

In the meantime, you can specify the specific Docker image you'd like to use in your Dockerfile via mhart/alpine-node:10. We currently recommend using Node 10.

For those of you using Node 14, you'll need to launch ganache-cli via node 8, 10, or 12 until this is fixed. For example, run nvm use 12 && npm install ganache-cli -g to install for node 12, and then run ganache-cli with nvm use 12 && ganache-cli.

Sorry for the temporary inconvenience while we update ganache-core internals to Node 14.

All 10 comments

I got the same issue. Please help to fix it. Thanks.

I have the same issue also, repeatable on both on my WSL Ubuntu 20.04 and my VirtualBox install of Ubuntu 20.04.

  • Version used (ganache-cli): v6.9.1
  • Version of Truffle/Remix/Other tools used: v5.1.24
  • NodeJS Version: v14.1.0
  • Operating System and version (include distro if Linux): Ubuntu 20.04 LTS

Got the same issue!!!
Please fix it...

In the meantime, you can specify the specific Docker image you'd like to use in your Dockerfile via mhart/alpine-node:10. We currently recommend using Node 10.

For those of you using Node 14, you'll need to launch ganache-cli via node 8, 10, or 12 until this is fixed. For example, run nvm use 12 && npm install ganache-cli -g to install for node 12, and then run ganache-cli with nvm use 12 && ganache-cli.

Sorry for the temporary inconvenience while we update ganache-core internals to Node 14.

Same issue on Ubuntu 20.04. No docker, just trying to run from terminal. I am using node 14 and have used the above from davidmurdoch for now. Is this going to be fixed?
Ganache CLI v6.9.1 (ganache-core: 2.10.2) Error: Callback was already called.

Same issue here, also on Ubuntu 20.04

Same issue here on both Windows 10 and WSL

Same issue here on Ubuntu 16.04

Looks like this issue is specific on Node v14 and not specific to your OS. As a temporary workaround you can:

  1. Just downgrade your node js version to 12.x, reinstall the package again (npm i ganache-cli -g) and don't worry until this issue is fixed.
  2. If you need features of Node 13+, use nvm to use Node v12 for ganache-cli as mentioned in above reply.
  3. if this is causing your CI tests to fail, remove 14.x from your nodejs version matrix for now.
Was this page helpful?
0 / 5 - 0 ratings