JavaScript Solutions, Competitive programming in JavaScript, MCQ in JS

Friday, 18 January 2019

Installing Ganache CLI & Installing Ganache GUI


What is Ganache?

Ganache is part of truffle suit of Ethereum developers tools for you personal blockchain for Ethereum development.
Ganache allows you to run your own blockchain on your local machine so you can test your contracts or DApp on your local machine instead of using testnet or mainnet.
  • Ganache comes with two components to make it user-friendly.
  1. Ganache CLI
  2. Ganache GUI

What is Ganache CLI?

Ganache CLI allows you to create your own local blockchain environment using terminal commands.
You can use terminal or CMD to run your ganache CLI.
Ganache CLI also included in Truffle so do not need to install it separately. 

Installing Ganache CLI

ganache-cli is written in JavaScript and distributed as a Node.js package via npm.

Using npm:

npm install -g ganache-cli
or you can use yarn 

yarn global add ganache-cli

but while installing it make sure you have Node.js (>= v6.11.5) installed on your local machine.

Running Ganache-cli

user@ubuntu:~$ ganache-cli

ganache-cli running

As you can see the screenshot of output, our local Ethereum development environment is ready to write and test our code, We are getting 9 addresses with 100 ETH in every account.

for more commands you can check Official Github link.

What is Ganache GUI?

Ganache GUI is a User Interface for Ganache CLI. It has many features, but can be generally described as a blockchain explorer.

Installing Ganache GUI

For this, first open a terminal window, create a folder for ganache and clone the source code:

mkdir ~/ganache
git clone
It will download the latest version of ganache, also it will download the latest version from the development branch. If you want something more stable or different version then you can download it from their release version.

Now goto ganache folder and install dependencies by using npm command.

npm install

Running Ganache GUI:

You can run using again npm command.
npm start


And when you click on Quickstart then it will come show our available wallets.

Ganache GUI

That's it, your local Etherum development environment is ready.
Enjoy coding ;)

Bonus: Linux: ./electron: error while loading shared libraries:

If you are using ubuntu then maybe you will get this error then you have to install libgconf.

sudo apt-get install libgconf-2-4 
and then install npm packages again.

Congratulations your Ganache is ready now !!!!

Please comment if you are getting any errors while installing.


  1. I am getting error while running npm install

    Unhandled rejection Error: Command failed: /usr/bin/git clone --depth=1 -q -b polyfill/globalThis git:// /home/nithin/.npm/_cacache/tmp/git-clone-ac4f7157
    /home/nithin/.npm/_cacache/tmp/git-clone-ac4f7157/.git: Permission denied

    at ChildProcess.exithandler (child_process.js:281:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:915:16)
    at (internal/child_process.js:336:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:561:12)

    I am getting error while npm start also
    > ganache@2.1.1-beta.0 start /home/nithin/ganache
    > electron-forge start

    sh: 1: electron-forge: not found
    npm ERR! file sh
    npm ERR! code ELIFECYCLE
    npm ERR! errno ENOENT
    npm ERR! syscall spawn
    npm ERR! ganache@2.1.1-beta.0 start: `electron-forge start`
    npm ERR! spawn ENOENT
    npm ERR!
    npm ERR! Failed at the ganache@2.1.1-beta.0 start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR! /home/nithin/.npm/_logs/2019-08-14T07_28_52_301Z-debug.log

  2. It showing permission issue, so I guess you have to do following steps.
    1. put sudo in front of the command to run as super user
    2.change the ownership of the relevant directories to yourself

  3. i keep getting this error please what can i do.

    *40 vulnerabilities required manual review and could not be updated
    2 package updates for 3 vulnerabilities involved breaking changes
    (use `npm audit fix --force` to install breaking changes; or refer to `npm audit` for steps to fix these manually)*