首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用Intellij调试咕噜

用Intellij调试咕噜
EN

Stack Overflow用户
提问于 2014-02-22 17:01:35
回答 1查看 6K关注 0票数 5

我正在尝试调试Intellij (IDEA)的咕噜声。技术有: NodeJS、快递、AngularJS。

问题:调试器不会停止在断点上。

我很高兴听到你的想法。

配置选项卡:

节点解释器:C:\ProgramFiles\nodejs\node.exe

Javscript文件: C:\Usersuser\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt

Browser / Live编辑选项卡:

代码语言:javascript
复制
http://localhost:3000/

下面是Gruntfile.js:

代码语言:javascript
复制
var path = require('path');

module.exports = function (grunt) {

grunt.initConfig({
    express: {
        dev: {
            options: {
                script: 'server.js'
            }
        },
    },
    watch: {
        html: {
            files: [ '**/*.html'],
            options: {
                livereload: true
            }
        },
        server: {
            files: [ 'server.js'],
            tasks: ['express:dev'],
            options: {
                livereload: true,
                spawn: false // Without this option specified express won't be reloaded
            }
        },
        js: {
            files: [ '**/*.js'],
            options: {
                livereload: true
            }
        }
    },
    open: {
        express: {
            // Gets the port from the connect configuration
            path: 'http://localhost:3000'
        }
    }

});

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-express-server');
grunt.loadNpmTasks('grunt-open');

grunt.registerTask('default', ['express:dev', 'watch' ])

};

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-02-25 14:58:38

刚刚尝试了一个示例Angular+Express应用程序作为Grunt任务运行。我用过你的Gruntfile.js (没变)。我的Node.js运行配置看起来像折叠:

配置选项卡:节点解释器: C:\Program文件: C:\Usersuser\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt工作目录:我的项目根目录- Gruntfile.js所在的文件夹

Live选项卡:启用启动后启用JavaScript调试器

代码语言:javascript
复制
http://localhost:3000

我在我的controllers.js中设置了断点,并在角度代码中的调试器=>断点中按预期运行上面的配置。)我的服务器代码中的断点不要:)

为了使服务器端代码中的断点正常工作,我执行了以下操作:

  • 在Gruntfile.js中添加了“debug:true”来开发选项:

表达式:{ dev:{ options:{ script:'server.js',调试: true } },

  • 修改node_modules\grunt-express-server\tasks\lib\server.js,第65行,将“--调试”更改为“--调试--brk=”(在我的示例中为“调试-brk=47977”)
票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21957411

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档