gatsby --version > -bash: gatsby: command not found

我怕爱的太早我们不能终老 提交于 2019-12-19 07:49:22

问题


I use mac and I installed gatsby-cli by:

npm install --global gatsby-cli

and 'npm root -g' command prints:

/usr/local/lib/node_modules/npm/lib/node_modules

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??


回答1:


you have to update your config. You may have to follow few steps

Set Config

remove existing config

npm config delete prefix 

set new config

npm config set prefix /usr/local

Install gatsby

npm i -g gatsby-cli

now check version

gatsby --version


来源:https://stackoverflow.com/questions/52378823/gatsby-version-bash-gatsby-command-not-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!