节点检查器未在断点处暂停

Node Inspector is Not Pausing on the Breakpoint

目前,我正在使用 Node V 9.3.0 并且在使用 Chrome 开发工具调试节点检查器时,请求没有在断点处暂停,你能帮我吗

重现步骤

  1. killall
  2. node node app.js
  3. node --inspect-brk app.js

我在 app.js

中有以下代码行
const users = require('./routes/users');
app.use('/users', users);

我在 users.js

中有以下代码
router.get('/profile', (req, res, next) => {
    res.send("User Profile");
});

现在我将断点放在行 router.get('/profile', (req, res, next) => { 和 运行 页面上 http://localhost:3000/users/profile ,页面立即加载而不会暂停。你能帮我一下吗

如果您有兴趣在提供页面之前暂停,断点可能需要在 res.send("User Profile") 行而不是 router.get...