概述
-
全局安装
grunt cli
工具:npm install -g grunt-cli
如提示有权限问题则使用:
sudo npm install -g grunt-cli
-
确认安装成功并查看
grunt
版本:grunt --version
-
如其它项目使用grunt命令时提示找不到grunt命令,如下提示
λ grunt -v grunt-cli: The grunt command line interface (v1.3.2) Fatal error: Unable to find local grunt. If you're seeing this message, grunt hasn't been installed locally to your project. For more information about installing and configuring grunt, please see the Getting Started guide: https://gruntjs.com/getting-started
则可以使用
npm install grunt --save-dev
或者直接
npm install
安装项目中
package.json
指定的grunt
版本。
再或者将当前项目package-lock.json
文件删除(如果有的话)再次安装
最后
以上就是单纯电灯胆为你收集整理的npm安装Grunt后却找不到命令的全部内容,希望文章能够帮你解决npm安装Grunt后却找不到命令所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复