ganache-cli command not found MacOS High Sierra

Created on 25 Dec 2017  路  6Comments  路  Source: trufflesuite/ganache-cli

running ganache-cli returns command not found

Expected Behavior

ganache-cli should return something and should not say command not found

Current Behavior

MacBook-Pro:~ susarla$ ganache-cli
-bash: ganache-cli: command not found

Steps to Reproduce (for bugs)

ganache-cli

Context

I am trying to run ganache-cli

Your Environment

I am running MacOS HS 10.13.1 with

MacBook-Pro:~ susarla$ node -v
v8.9.3
MacBook-Pro:~ susarla$ npm -v
5.5.1
MacBook-Pro:~ susarla$ which node
/usr/local/bin/node
MacBook-Pro:~ susarla$ which npm
/usr/local/bin/npm

Most helpful comment

To fix this problem make sure that

  1. You've installed ganache-cli globally by doing npm install -g
  2. Your npm global bin directory is in your PATH. You can find your npm global bin directory by running npm bin -g

For item 2, copy and paste this one-liner and it'll tell you whether or not you're in good shape:

echo $PATH | grep -q "$(npm bin -g)" && echo "Your PATH is set up correctly." || echo "You need to add '$(npm bin -g)' to your path variable."

All 6 comments

did you npm install -g ganache-cli?

see: https://github.com/trufflesuite/ganache-cli#installation

I've encountered same issue after installing ganache-cli with npm on Debian 9 x86_64.

[Update] Solved the issue by using sudo when installing the package.

To fix this problem make sure that

  1. You've installed ganache-cli globally by doing npm install -g
  2. Your npm global bin directory is in your PATH. You can find your npm global bin directory by running npm bin -g

For item 2, copy and paste this one-liner and it'll tell you whether or not you're in good shape:

echo $PATH | grep -q "$(npm bin -g)" && echo "Your PATH is set up correctly." || echo "You need to add '$(npm bin -g)' to your path variable."

NOENT: no such file or directory, access '/usr/local/lib/node_modules/ganache-cli'
still not working

npm WARN deprecated [email protected]: 馃檶 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/ganache-cli
npm WARN [email protected] requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! path /usr/local/lib/node_modules/ganache-cli
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access '/usr/local/lib/node_modules/ganache-cli'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! /var/root/.npm/_logs/2018-04-07T13_59_07_679Z-debug.log

sudo su
npm install -g ganache-cli
root@ide:/# cd /usr/bin
root@ide:/usr/bin# ls -lrth

you will get below type of listing
lrwxrwxrwx 1 root root 38 Aug 8 12:09 ganache-cli -> ../lib/node_modules/ganache-cli/cli.js

root@ide:/usr/bin# ./ganache-cli

and it started.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kumavis picture kumavis  路  3Comments

remote-gildor picture remote-gildor  路  4Comments

zweicoder picture zweicoder  路  3Comments

mariam-crissi picture mariam-crissi  路  6Comments

redshark1802 picture redshark1802  路  4Comments