标签:grunt 前端开发 uglify gruntfile error
E:\website\jquery-plugins>grunt
A valid Gruntfile could not be found. Please see the getting started guide for
more information on how to configure grunt: http://gruntjs.com/getting-started
Fatal 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> grunt
Loading "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>grunt
Running "uglify:build" (uglify) task
>> 1 file created.
Done, without errors.
grunt错误——Fatal error: Unable to find Gruntfile
标签:grunt 前端开发 uglify gruntfile error
原文地址:http://blog.csdn.net/sspeed5cm/article/details/45641705