Gatsby : -bash: gatsby: 在 npm 安装后找不到命令

Gatsby : -bash: gatsby: command not found after npm install

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

bash:gatsby command not found

我试过:

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

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

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

提前致谢,

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