mainchain
mainchain

Reputation: 31

Getting No such file or directory: 'ganache-cli' error

I installed ganache-cli using npm install -g ganache-cli, however I am running into a No such file or directory: 'ganache-cli error when trying to run it. When calling echo $PATH, I see ~/.npm-global/bin, which contains the ganache-cli file, so I am confused as to what the issue could be. Any help is greatly appreciated.

For reference, I am using zsh on MacOS.

Upvotes: 2

Views: 1322

Answers (1)

Ankit Shubham
Ankit Shubham

Reputation: 3599

ganache-cli is now deprecated. You might see the following npm-warning:

npm WARN deprecated [email protected]: ganache-cli is now ganache; visit https://trfl.io/g7 for details

Use npm install -g ganache.

Use sudo npm install -g ganache if you get some error like this:

$ npm install -g ganache
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2022-06-23T12_37_16_476Z-debug.log

Upvotes: 1

Related Questions