'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



Solution 1:[1]

if you are on linux(my case ubuntu) and you encoutered this issue. you should try

    $sudo npm install -g ganache

OR

    $sudo yarn global add ganache

This is probably because you used sudo privileges to install npm and yarn in first place. happy hacking :)

Solution 2:[2]

For Win10: update PATH env variable adding

C:\Users\myUserName\AppData\Local\Yarn\bin

FYI: In that dir there are 2 files:

ganache-cli
ganache-cli.cmd

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 goodnews john
Solution 2