我的问题是,如何像默认的节点启动脚本那样来报告错误。在最近的节点/快速项目中,我尝试使用Grunt任务管理器,并将开始脚本更改为
"start": "node ./bin/www"至
"start": "grunt"问题是,当我运行"npm启动“或”咕哝“时,错误报告是不够的。
[nodemon]app crashed - waiting for file changes before starting //error reported by grunt当我将开始脚本改为"node ./bin/www“时,我看到的错误如下
Error: Cannot find module mongoose //error reported by node这表明,我已经忘记了npm安装猫鼬。那么我怎样才能让Grunt报告这个错误呢?
编辑:节点报告的另一个错误示例
MissingSchemaError: Schema hasnt been registed for model "Admin" //error reported by node编辑2: gruntfile.js配置如下
/**** other configurations to minify and uglify ****/
nodemon: {
dev: {
script: 'server.js'
}
},
// run watch and nodemon at the same time
concurrent: {
options: {
logConcurrentOutput: true
},
tasks: ['nodemon', 'watch']
}
grunt.loadNpmTasks('grunt-nodemon');
grunt.loadNpmTasks('grunt-concurrent');发布于 2016-10-11 20:22:41
有两种方法可以做到这一点:
--stack选项:
“开始”:“咕哝-堆叠”stack中启用gruntfile.js选项:
Grunt.option(“堆栈”,真);https://stackoverflow.com/questions/39979001
复制相似问题