【问题标题】:Getting No such file or directory: 'ganache-cli' error没有这样的文件或目录:'ganache-cli'错误
【发布时间】:2022-06-23 20:44:22
【问题描述】:
我使用npm install -g ganache-cli 安装了 ganache-cli,但是在尝试运行它时遇到了No such file or directory: 'ganache-cli 错误。调用echo $PATH 时,我看到~/.npm-global/bin,其中包含ganache-cli 文件,所以我很困惑可能是什么问题。非常感谢任何帮助。
作为参考,我在 MacOS 上使用 zsh。
【问题讨论】:
标签:
npm
path
ethereum
ganache
brownie
【解决方案1】:
ganache-cli 现已弃用。您可能会看到以下 npm 警告:
npm WARN deprecated ganache-cli@6.12.2: ganache-cli is now ganache; visit https://trfl.io/g7 for details
使用npm install -g ganache。
如果您遇到如下错误,请使用sudo npm install -g ganache:
$ 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