error in ganache installation: The term 'ganache-cli' is not recognized as the name of a cmdlet, function, script file, or operable program
Asked Answered
H

5

6

I installed ganache with yarn, but when I check the version to see if correctly installed, I get the error: "The term 'ganache-cli' is not recognized as the name of a cmdlet, function, script file, or operable program". enter image description here

Hawes answered 18/9, 2021 at 16:15 Comment(1)
The issue was solved by not using yarn for installation but: $ npm install -g ganache-cliHawes
J
17

I had the same issue but then I installed with npm and it worked

npm install -g ganache-cli
Jala answered 18/10, 2021 at 2:19 Comment(0)
D
2

for all people like me who came across this question after a while, ganache-cli on npm is now ganache. and it is better to use:

npm install -g ganache 

please checkout ganache page on npm.

Demasculinize answered 18/2, 2022 at 16:23 Comment(0)
A
1

run commond "npx ganache-cli" instead of "ganach

Agulhas answered 6/9, 2022 at 6:11 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Meri
C
0

Even after installing with the below command its possible you will run into the same issue.

npm install -g ganache-cli

In this case check if your path in environment variable is set correctly or is missing.

Environment Variable -> System Variable -> Path

It should be something like this

%UserProfile%\AppData\Roaming\npm

Also once this is set, close your cmd or terminal and try running the Ganache-cli command in a fresh terminal instance.

Consentient answered 26/11, 2021 at 6:25 Comment(0)
K
0

Just adding one more point to @OZahed's answer.

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
Kiddush answered 23/6, 2022 at 12:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.