Ganache-cli: ganace-cli is not recognized

Created on 11 Jan 2018  路  2Comments  路  Source: trufflesuite/ganache-cli

Expected Behavior



I installed ganache-cli using npm install -g ganache-cli as told

Current Behavior



When I type ganache-cli it returns ganache-cli : The term 'ganache-cli' is not recognized

Possible Solution



Change %PATH%. Did that, added Node_Modules to the path variable. Run as admin, did that, nothing changes.
When I go to %appdata%\Roaming\npm and type .\ganache-cli it runs

Steps to Reproduce (for bugs)


  1. npm install -g ganache-cli
  2. ganache-cli

Context



I want to create a client and build a smart contract using this

Your Environment

  • Version used:
  • Environment name and version (e.g. PHP 5.4 on nginx 1.9.1):
  • Server type and version:
  • Operating System and version: Windows 10 64-bit
  • Link to your project:
question

Most helpful comment

That fixed it, thanks a lot! When I ran npx -v it returned "Path must be a string". Upon installing npx it works perfectly.

All 2 comments

Please verify that the path listed when you run npm bin -g is in your PATH. If it is, please try the following:

Do other npm modules installed with the -g flag run?

Try the following

  1. Open PowerShell, and try to run npx - verify that it doesn't run
  2. Run npm install -g npx
  3. Try to run npx now - is the command found?

If npx is found on step 3, and if ganache-cli still doesn't run, then this is likely a problem with ganache-cli. If npx does run, try running Get-Command npx, then go look in whatever directory npx.cmd is in and see if ganache-cli.cmd is there.

On my Windows 10 system when I run Get-Command ganache-cli it tells me that ganache-cli.cmd is located at C:\Program Files\nodejs\ganache-cli.cmd, which is aligned with the output of npm bin -g. I'm not sure if this is the usual path for all recent versions of npm, or if my system is doing something a bit different because I'm using NVM for windows, but npm bin -g or this method should get you on the right track.

Closing this for now, as there's not much else I can offer assistance-wise. If after troubleshooting you feel this is an issue with the way ganache-cli is packaged/distributed, please reopen. Otherwise, please check out the Truffle gitter channel for more immediate help on setup questions like these.

That fixed it, thanks a lot! When I ran npx -v it returned "Path must be a string". Upon installing npx it works perfectly.

Was this page helpful?
0 / 5 - 0 ratings