【问题标题】:Gatsby : -bash: gatsby: command not found after npm installGatsby : -bash: gatsby: npm install 后找不到命令
【发布时间】:2019-11-12 02:32:02
【问题描述】:

当我尝试安装运行 npm install gatsby-cli -g 的 gatsby 时,它不起作用:当我运行 gatsby --help 时,它显示:

bash:gatsby 命令未找到

我试过了:

  1. 卸载并重新安装 NPM
  2. 这个 gitHub 解决方案:https://github.com/gatsbyjs/gatsby/issues/4967 尝试更改 npm config set prefix /usr/local 时出现权限错误

我正在使用 mac(版本 10.14.5)。
我的环境详情如下:
npm -v:6.9.0
节点 -v : v10.16.0

我该怎么做才能让它发挥作用?

提前致谢,

【问题讨论】:

标签: npm gatsby


【解决方案1】:

如果是权限错误,您可以使用sudo npm install gatsby-cli -g 以超级用户身份运行它。当我全局安装某些东西时,我必须这样做。

【讨论】:

  • 非常感谢它的工作!我遵循了 github 解决方案,但做了sudo npm install gatsby-cli -g
猜你喜欢
  • 2019-11-24
  • 2013-10-13
  • 2021-04-11
  • 1970-01-01
  • 2016-02-08
  • 2023-03-15
  • 1970-01-01
  • 2017-12-19
  • 2012-12-21
相关资源
最近更新 更多