今天在git命令行工具中使用 grunt的时候,总是提示我找不到grunt命令,如:

sh.exe": grunt: command not found

  但是我运行 npm install -g grunt-cli 和 npm install -g grunt 都安装成功,且没有错误提示。

然而我打开我以前的grunt项目,也同样提示我找不到 grunt 命令,我就纳闷了,以前还好好的。

 

然后google一下,发现是windows下的环境变量(path)不对,可能是不小心删掉了一些东西。然后我在环境变量的 path 下添加了如下代码:

C:\Users\Username\AppData\Roaming\npm\;

  然后再重启git,就好了。

相关文章:

  • 2021-07-22
  • 2021-07-22
  • 2021-12-23
  • 2021-09-30
  • 2021-06-23
  • 2021-04-29
  • 2021-09-06
猜你喜欢
  • 2021-09-12
  • 2021-08-19
  • 2021-09-05
  • 2021-07-17
  • 2021-11-17
相关资源
相似解决方案