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



目前,我正在使用节点V 9.3.0,并且在使用Chrome开发工具调试节点检查器时,请求未在断点上暂停,您能在这里帮助我吗

重现步骤

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

我在应用程序中有以下代码行.js

const users = require('./routes/users');
app.use('/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...行上

最新更新