sh.exe": grunt: command not found

今天在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:UsersUsernameAppDataRoaming
pm;

  然后再重启git,就好了。

原文地址:https://www.cnblogs.com/ayseeing/p/4460416.html