E:\website\jquery-plugins>gruntA valid Gruntfile could not be found. Please see the getting started guide formore information on how to configure grunt: http://gruntjs.com/getting-startedFatal error: Unable to find Gruntfile.
错误提示Gruntfile.js
文件找不到,但项目中已经有Gruntfile.js
文件,后来发现是用npm
安装grunt
模块时,没有安装完整(可能是中途中断了安装,但grunt
模块的目录已经存在与node_modules
目录下),解决办法是重新安装grunt
模块:
E:\website\jquery-plugins>npm install grunt
再次执行:
E:\website\jquery-plugins> gruntLoading "uglify.js" tasks...ERROR>> Error: ENOENT, no such file or directory 'E:\website\jquery-plugins\node_modules\grunt-contrib-uglify\node_modules\uglify-js\lib\utils.src'Warning: Task "uglify" not found. Use --force to continue.Aborted due to warnings.
错误提示没有这个文件或者目录,猜测grunt
的uglify
插件也没有安装完整,重新安装:
E:\website\jquery-plugins>npm install grunt-contrib-uglify --save-dev
执行grunt
的默认tasks
(我这里的默认tasks
只有uglify
)
E:\website\jquery-plugins>gruntRunning "uglify:build" (uglify) task>> 1 file created.Done, without errors.