Grunt在Windows 8上:'grunt'无法识别 [英] Grunt on Windows 8: 'grunt' is not recognized

查看:555
本文介绍了Grunt在Windows 8上:'grunt'无法识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Windows 8机器上从命令行运行Grunt时遇到问题。



我的研究表明,最常见的解决方案是安装grunt-cli,因为Grunt不再是全球性的。我还需要确保我实际安装了Grunt任务运行器,因为它没有安装grunt-cli。



其他解决方案指向PATH系统环境变量,但看起来像我期望的那样指向:


C:\ Users [用户名] \AppData\Roaming\\\
pm


完成所有这些后,我仍然在CLI中发现咕噜声未被识别为内部或外部命令,可操作程序或批处理文件错误消息。我尝试了以下事情,在每次尝试后卸载所有内容:


  • 全局安装grunt-cli(npm install -g grunt-cli) ,然后在我想要使用它的目录级别进行grunt(npm install grunt)

  • 与上面相同,但安装顺序颠倒了

  • 与上述两者相同,但使用管理命令提示符



我是否缺少明显的东西?

解决方案

确认你的 PATH 是正确的(而不是搞砸了)。只需在命令提示符下键入 PATH 即可。考虑到你描述的错误和你采取的步骤,真的没有其他解释是有道理的。

通常,使用其中grunt 命令会找到 grunt.cmd npm 已正确安装,并且已正确添加到系统路径中,请在您的路径中输入c $ c>。

I'm having a problem running Grunt from the command line on my Windows 8 machine.

My research indicates the most common solution is to install grunt-cli, since Grunt is no longer global. I also need to make sure I actually install the Grunt task runner, since that's not installed with grunt-cli.

Other solutions point to the PATH system environment variable, but that appears to be pointed as I'd expect to:

C:\Users[username]\AppData\Roaming\npm

Having done all that, I'm still getting a "'grunt' is not recognized as an internal or external command, operable program or batch file" error message in the CLI. I've tried the following things, uninstalling everything after every attempt:

  • Installed grunt-cli globally (npm install -g grunt-cli), then grunt at the directory level I want to use it (npm install grunt)
  • The same as above, but with the order of installation reversed
  • The same as both of the above, but using the Admin Command Prompt

Am I missing something obvious?

解决方案

Confirm your PATH is correct (and not messed up). Just type PATH from the command prompt. There's really no other explanation that makes sense given the error you're describing and the steps you've taken.

Normally, using the where grunt command would have found grunt.cmd in your path if npm is installed correctly and it has been properly added to the system path.

这篇关于Grunt在Windows 8上:'grunt'无法识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆