Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/415.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript npm Grunt加载,但Grunt命令无法识别_Javascript_Command Line_Npm_Gruntjs - Fatal编程技术网

Javascript npm Grunt加载,但Grunt命令无法识别

Javascript npm Grunt加载,但Grunt命令无法识别,javascript,command-line,npm,gruntjs,Javascript,Command Line,Npm,Gruntjs,我以前在这台计算机上使用grunt进行其他项目(4个月前),最近想在一个新项目中使用grunt。我先在全局加载grunt,然后在本地加载grunt,但之后键入$grunt-v表示grunt不会被识别为未加载,或者路径可能是错误的?有人有什么想法吗? 更新:2016年5月16日,我尝试了以下建议,并在全局和本地加载了casper cli,但grunt命令仍然失败。此外,我还尝试了另一个命令“casperjs”,该命令也失败了,尽管它在过去一年左右一直运行良好。看来我所有的命令都不起作用了,这可能

我以前在这台计算机上使用grunt进行其他项目(4个月前),最近想在一个新项目中使用grunt。我先在全局加载grunt,然后在本地加载grunt,但之后键入$grunt-v表示grunt不会被识别为未加载,或者路径可能是错误的?有人有什么想法吗?

更新:2016年5月16日,我尝试了以下建议,并在全局和本地加载了casper cli,但grunt命令仍然失败。此外,我还尝试了另一个命令“casperjs”,该命令也失败了,尽管它在过去一年左右一直运行良好。看来我所有的命令都不起作用了,这可能是什么原因呢


要在控制台中使用grunt,必须全局安装grunt cli:
npm安装grunt cli-g

您必须全局安装grunt cli才能在控制台中使用grunt:
npm install grunt cli-g

如果您不想全局安装,package.json中调用grunt的简单脚本也可以工作如果您不想全局安装,package.json中调用grunt的简单脚本也可以工作