Javascript Node.JS/Grunt Nodemon:ReferenceError:未定义模式
我目前正在学习Node.JS,希望通过Grunt提高我的开发速度。我已经通过NPM在全球安装了“grunt cli”,也在本地安装了“grunt nodemon”作为开发资源。目标是只要JavaScript文件发生更改,Node.JS就会重新启动 以下是我在控制台中得到的信息:Javascript Node.JS/Grunt Nodemon:ReferenceError:未定义模式,javascript,node.js,gruntjs,Javascript,Node.js,Gruntjs,我目前正在学习Node.JS,希望通过Grunt提高我的开发速度。我已经通过NPM在全球安装了“grunt cli”,也在本地安装了“grunt nodemon”作为开发资源。目标是只要JavaScript文件发生更改,Node.JS就会重新启动 以下是我在控制台中得到的信息: D:\Projects\NodeJS\Web\Board\>grunt Loading "gruntfile.js" tasks...ERROR >> ReferenceError: mode is n
D:\Projects\NodeJS\Web\Board\>grunt
Loading "gruntfile.js" tasks...ERROR
>> ReferenceError: mode is not defined
Warning: Task "default" not found. Use --force to continue.
Aborted due to warnings.
这是我的Grunfile.js:
//gruntfile.js
mode.exports = function (grunt) {
grunt.initConfig({
nodemon: {
all: {
script: 'server.js',
options: {
watchedExtensions: ['js']
}
}
},
});
grunt.loadNpmTasks('grunt-nodemon');
grunt.registerTask('default', ['nodemon']);
};
控制台指向的目录与gruntfile.js所在的目录相同
如果你有任何想法,请告诉我。谢谢 代码的第1行是
mode.exports
应该是
module.exports // change mode to module. Its a typo in your code
因此出现了错误
ReferenceError: mode is not defined
检查打字错误。快乐编码 代码的第1行是
mode.exports
应该是
module.exports // change mode to module. Its a typo in your code
因此出现了错误
ReferenceError: mode is not defined
检查打字错误。快乐编码 代码的第1行是
mode.exports
应该是
module.exports // change mode to module. Its a typo in your code
因此出现了错误
ReferenceError: mode is not defined
检查打字错误。快乐编码 代码的第1行是
mode.exports
应该是
module.exports // change mode to module. Its a typo in your code
因此出现了错误
ReferenceError: mode is not defined
检查打字错误。快乐编码 尝试删除最后一行括号后的逗号。尝试删除最后一行括号后的逗号。尝试删除最后一行括号后的逗号。尝试删除最后一行括号后的逗号。尝试删除最后一行括号后的逗号。重复了10次。哈哈哈,非常感谢!有时会发生。快乐的编码伙伴!经历了10次。哈哈哈,非常感谢!有时会发生。快乐的编码伙伴!经历了10次。哈哈哈,非常感谢!有时会发生。快乐的编码伙伴!经历了10次。哈哈哈,非常感谢!有时会发生。快乐的编码伙伴!