gatsby --version> -bash:gatsby:找不到命令 [英] gatsby --version > -bash: gatsby: command not found
本文介绍了gatsby --version> -bash:gatsby:找不到命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用Mac,并通过以下方式安装了gatsby-cli:
I use mac and I installed gatsby-cli by:
npm install --global gatsby-cli
和'npm root -g'命令打印:
and 'npm root -g' command prints:
/usr/local/lib/node_modules/npm/lib/node_modules
npm成功安装了gatsby,但是, 我无法运行gatsby命令(gatsby --version,gatsby --help) 每当我键入并运行"gatsby --version"时,都会打印:
npm successfully installed gatsby but, I cannot run gatsby command (gatsby --version, gatsby --help) Whenever I type and run "gatsby --version" it prints:
-bash: gatsby: command not found
有什么办法可以解决这个问题?
Is there any way I can fix this problem??
推荐答案
您必须更新配置.您可能需要遵循几个步骤
you have to update your config. You may have to follow few steps
设置配置
删除现有配置
npm config delete prefix
设置新配置
npm config set prefix /usr/local
安装盖茨比
npm i -g gatsby-cli
现在检查版本
gatsby --version
这篇关于gatsby --version> -bash:gatsby:找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文