我使用npm install -g ganache-cli安装了ganache-cli,但是在尝试运行它时遇到了No such file or directory: 'ganache-cli错误。在调用echo $PATH时,我看到了包含ganache文件的~/.npm-global/bin,所以我对这个问题可能是什么感到困惑。任何帮助都是非常感谢的。
作为参考,我在MacOS上使用zsh。
发布于 2022-06-23 12:44:22
加纳奇-克莱伊现在不受欢迎了。您可能会看到以下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.loghttps://stackoverflow.com/questions/70804493
复制相似问题