Today, I learned that there was a problem with starting grunt, after it was configured:
Loading "gruntfile.js" tasks...ERROR
>> SyntaxError: Unexpected token .
Warning: Task "default" not found. Use --force to continue.
Aborted due to warnings.
my 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"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
I have checked the format parentheses and other questions several times, and then the three components used in it have checked the relevant documents and checked the related questions in Stack Overflow, but those solutions are very personal. Who can help me a lot?