为了账号安全,请及时绑定邮箱和手机立即绑定

在执行grunt copy时提示错误

在执行grunt copy时提示错误

snow2012 2015-04-13 21:51:56
提示错误:D:\grunt-in-action\grunt-empty>grunt copyLoading "Gruntfile.js" tasks...ERROR>> ReferenceError: grunt is not definedWarning: Task "copy" not found. Use --force to continue.我的Gruntfile.js内容如下:'use strict'//grunt的基本框架module.exports=function(grunt){//引组件reqire("load-grunt-tasks")(grunt);reqire("time-grunt")(grunt);//配置项目路径var config={app:'app',dist:'dist'};};//开始任务配置grunt.initConfig({//引入config设置config:config,copy:{dist:{src:'<%= config.app %>/index.html',//源文件dest:'<%= config.dist %>/index.html'//目标文件}}});我的package.json:{  "name": "grunt-empty",  "version": "1.0.0",  "description": "learn grunt by the empty project",  "main": "index.js",  "scripts": {    "test": "echo \"Error: no test specified\" && exit 1"  },  "keywords": [    "grunt",    "empty",    "merge"  ],  "author": "zrx",  "license": "ISC",  "devDependencies": {    "grunt": "^0.4.5",    "grunt-contrib-copy": "^0.8.0",    "load-grunt-tasks": "^3.1.0",    "time-grunt": "^1.1.0"  }}
查看完整描述

1 回答

?
snow2012

TA贡献1条经验 获得超2个赞

已经发现问题所在,grunt.initConfig写错位置了

查看完整回答
2 反对 回复 2015-04-13
  • 1 回答
  • 0 关注
  • 2094 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号