Command not found - installing ganache-cli with yarn on Visual Studio

Viewed 649

I've installed nodeJS in the terminal of Visual Studio version :

v16.13.1

Yarn

1.22.17

Ganache-cli

MacBook:web3_py_simple_storage myName$ yarn global add ganache-cli

warning ../package.json: No license field
[1/4]   Resolving packages...
[2/4]   Fetching packages...
[3/4]   Linking dependencies...
[4/4]   Building fresh packages...
success Installed "ganache-cli@6.12.2" with binaries:
      - ganache-cli
✨  Done in 1.10s.```


BUT when I try to do `ganache-cli --version`, I always received the same msg `bash: ganache-cli: command not found`... I maybe think it's a path problem but I tried a lot and a lot of solution and still nothing.. 

I really thanks a lot in advance the guy who will help me !
2 Answers

I encountered the same issue earlier today, got it solved by typing this command in my visual studio terminal

npm install -g ganache-cli

(Note: You must have Nodejs already installed) After the installation simply run the command below

ganache-cli --version to check if it was installed properly

I used npm install -g ganache and it solved my problem, but when I want to start Ganache-cli, run with npx ganache-cli.

Related