ganache 安装错误:术语 'ganache-cli' 未被识别为 cmdlet、函数、脚本文件或可运行程序的名称

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

我用 yarn 安装了 ganache,但是当我检查版本以查看是否正确安装时,我收到错误消息:“术语 'ganache-cli' 无法识别为 cmdlet、函数、脚本文件的名称, 或可运行的程序”。

我遇到了同样的问题,但后来我安装了 npm 并且成功了

npm install -g ganache-cli

即使在使用以下命令安装后,您也可能 运行 遇到同样的问题。

npm install -g ganache-cli

在这种情况下,请检查您在环境变量中的路径是否设置正确或丢失。

环境变量->系统变量->路径

应该是这样的

%UserProfile%\AppData\Roaming\npm

此外,一旦设置完成,请关闭您的 cmd 或终端并尝试 运行在新的终端实例中执行 Ganache-cli 命令。

对于所有像我一样一段时间后遇到这个问题的人来说,npm 上的 ganache-cli 现在是 ganache。最好使用:

npm install -g ganache 

请结帐ganache page on npm