猿问

Grunt 启动后报错Warning: Task "default" not found.实在找不到

今天学习grunt,在配置好之后启动出现一下问题:


Loading "gruntfile.js" tasks...ERROR

>> SyntaxError: Unexpected token .

Warning: Task "default" not found. Use --force to continue.


Aborted due to warnings.

我的gruntfile.js


'use strict'

module.exports = function(grunt){

    grunt.initConfig({

        // watch的配置

        watch : {

            jade :{

                files : ['views/**'],

                options : {

                    livereload : true

                }

            },

            js : {

                files : ['page/**'],

                options : {

                    livereload : true

                }

            }

        },

        nodemon : {

            dev : {

                script : 'app.js',

                options : {

                    args : [],

                    nodeArgs : ['--debug'],

                    ignore : ['README.md', 'node_modules/**', '.DS_Store'],

                    ext : 'js',

                    watch : [./],

                    delay : 1000,

                    env : {

                        PORT : '3000'

                    },

                    cwd : __dirname

                }

            }

        },

        concurrent : {

            tasks : ['nodemon','watch'],

            options : {

                logConcurrentOutput : true

            }

        }


    }); 


    grunt.loadNpmTasks('grunt-contrib-watch');

    grunt.loadNpmTasks('grunt-nodemon');

    grunt.loadNpmTasks('grunt-concurrent');

    

    grunt.option('force', true);

    grunt.registerTask('default', ['concurrent']);

}

package.json


{

  "name": "myblog",

  "version": "1.0.0",

  "description": "",

  "main": "app.js",

  "dependencies": {

    "bootstrap": "^3.3.7",

    "express": "^4.16.3",

    "grunt": "^1.0.2",

    "grunt-contrib-watch": "^1.0.1",

    "jade": "^1.11.0",

    "serve-static": "^1.13.2",

    "wangeditor": "^3.1.1"

  },

  "devDependencies": {

    "grunt-concurrent": "^2.3.1",

    "grunt-nodemon": "^0.4.2"

  },



格式括号等问题我都排查了好几遍,然后里面运用到的3个组件都分别去查看了相关文档,也在Stack Overflow查了相关的问题,但是那些解答都非常私人化.哪位大大可以帮忙排查一下.


眼眸繁星
浏览 857回答 1
1回答
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答