Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

command not found: ganache-cli

I have installed and reinstalled npm to try to run ganache and it has not been successful..really need help here!


(base) user bin % npm install -g ganache-cli

changed 6 packages, and audited 102 packages in 4s

2 packages are looking for funding run npm fund for details

8 vulnerabilities (7 moderate, 1 high)

To address issues that do not require attention, run: npm audit fix

To address all issues (including breaking changes), run: npm audit fix --force

Run npm audit for details. (base) user bin % ganache-cli zsh: command not found: ganache-cli

like image 460
YAL Avatar asked Aug 26 '26 09:08

YAL


1 Answers

The most likely cause is that the global modules installation directory is not in your path. As a quick workaround, you can run it like this:

`npm root -g`/ganache-cli/cli.js

A better idea (aside from fixing your PATH!) would be to install it as a dev dependency in the project that needs it (so npm install -D instead of npm install -g) and then run it with npx (so npx ganache-cli rather than ganache-cli).

like image 84
Trott Avatar answered Aug 28 '26 10:08

Trott



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!