-
全局安装
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后却找不到命令内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复