获取"没有此类文件或目录":'ganache-cli'错误



我使用npm install -g ganache-cli安装了ganache cli,但在尝试运行它时遇到了No such file or directory: 'ganache-cli错误。在调用echo $PATH时,我看到了包含ganache cli文件的~/.npm-global/bin,所以我不知道可能是什么问题。非常感谢您的帮助。

作为参考,我在MacOS上使用zsh。

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

相关内容

最新更新