Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/EmptyTag/148.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gruntjs Grunt错误:未指定的标记{语法错误_Gruntjs_Grunt Contrib Uglify_Grunt Contrib Concat - Fatal编程技术网

Gruntjs Grunt错误:未指定的标记{语法错误

Gruntjs Grunt错误:未指定的标记{语法错误,gruntjs,grunt-contrib-uglify,grunt-contrib-concat,Gruntjs,Grunt Contrib Uglify,Grunt Contrib Concat,嗨,我正试图从youtube学习grunt教程,我遵循视频中提到的相同说明 但是在我的系统中运行命令grunt时,我得到了一个错误,我无法解决它 下面是我的包。json { "name": "shreyansh", "version": "1.0.0", "description": "running grunt test", "main": "index.html", "author": "shreyansh", "devDependencies": { "gr

嗨,我正试图从youtube学习grunt教程,我遵循视频中提到的相同说明

但是在我的系统中运行命令grunt时,我得到了一个错误,我无法解决它

下面是我的包。json

{
  "name": "shreyansh",
  "version": "1.0.0",
  "description": "running grunt test",
  "main": "index.html",
  "author": "shreyansh",
  "devDependencies": {
    "grunt": "^1.0.1",
    "grunt-contrib-cssmin": "^1.0.2",
    "grunt-contrib-uglify": "^2.0.0"
  }
}
grunfile.js

module.exports = funtion(grunt) {


        grunt.initConfig({

            pkg: grunt.file.readJSON('package.json'),

            cssmin: {
                combine:{
                    files:{
                        'Project/css/main.css': [ 'file-upload.css']
                    }
                }
            } 

        });


        grunt.LoadNpmTasks('grunt-contrib-cssmin');     

        grunt.registerTask('default', ['cssmin'])

};
错误:-

正在加载“Gruntfile.js”任务…错误>>语法错误:意外标记{ 警告:未找到任务“默认值”。请使用--force继续。 由于警告而中止

我试图从stackoverflow中寻找类似的错误问题,但没有成功。 感谢您的帮助,因为我是第一次使用grunt


谢谢

修复Grunfile第1行的输入错误,将
功能更改为
功能

module.exports = function(grunt) {


    grunt.initConfig({

        pkg: grunt.file.readJSON('package.json'),

        cssmin: {
            combine:{
                files:{
                    'Project/css/main.css': [ 'file-upload.css']
                }
            }
        }

    });


    grunt.LoadNpmTasks('grunt-contrib-cssmin');

    grunt.registerTask('default', ['cssmin'])

};

修正GrunFile第1行的输入错误,将
功能更改为
功能

module.exports = function(grunt) {


    grunt.initConfig({

        pkg: grunt.file.readJSON('package.json'),

        cssmin: {
            combine:{
                files:{
                    'Project/css/main.css': [ 'file-upload.css']
                }
            }
        }

    });


    grunt.LoadNpmTasks('grunt-contrib-cssmin');

    grunt.registerTask('default', ['cssmin'])

};

输入错误:
funtion
谢谢,无法找到问题:-)输入错误:
funtion
谢谢,无法找到问题:-)