当你在使用grunt命令时提示:grunt: command not found
,说明你的本地环境没有grunt命令。
执行命令安装grunt:
npm install grunt
使用命令grunt -version
查看安装的版本
碰到错误提示:Fatal error: Unable to find local grunt.
使用命令npm install grunt --save-dev
更新版本。
如果提示以下信息:
>> Local Npm module "grunt-contrib-clean" not found. Is it installed?
>> Local Npm module "grunt-contrib-concat" not found. Is it installed?
>> Local Npm module "grunt-contrib-watch" not found. Is it installed?
>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-contrib-copy" not found. Is it installed?
>> Local Npm module "grunt-contrib-jasmine" not found. Is it installed?
则是grunt.js缺少以上引用,使用 npm install (module name)
以此安装即可。