node.js - ( Node :11684) [DEP0062] DeprecationWarning: `node --inspect --debug-brk` is deprecated. 请改用 `node --inspect-brk`

标签 node.js visual-studio-2017 visual-studio-debugging

自从升级 NodeJs 以来,我从 Visual Studio 2017 运行 Nodejs 时遇到此错误。

断点也不起作用。 有任何解决这个问题的方法吗?

注意: VS版本是15.5.6 NodeJS 版本 8.9.4

最佳答案

我遇到了同样的问题,以下内容对我有用。

第一个解决方案

将 launch.json 更改为

< "protocol": "legacy",
> "protocol": "auto",

这应该有效。

第二个解决方案

在 package.json 中:

scripts: {
  "debug": "DEBUG=pd* nodemon --inspect-brk --harmony --nolazy server.js"
}

然后是来自最新 VS Code 的 Node 的默认调试启动配置:

{  
    "type": "node",
    "request": "attach",
    "name": "Attach",
    "port": 9229
}

两者都为我工作。

关于node.js - ( Node :11684) [DEP0062] DeprecationWarning: `node --inspect --debug-brk` is deprecated. 请改用 `node --inspect-brk`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48623841/

相关文章:

javascript - 开 Jest toMatchObject 会抛出 TypeError

node.js - 如何使用 CLI 将 Microsoft botbuilder Nodejs 应用程序部署到 azure?

php - 我如何使用 Node.js 或 PHP 实时监听 MySQL 数据库变化

javascript - Discord js/检查用户是否在特定语音 channel 中

c++ - 让 Visual Studio 中断用户(std::exception)异常?

c++ - Visual Studio 不会因断言违规而中断

c# - 如何打包和部署带有符号和源代码的 NuGet 包,以便调试器可以使用该源代码?

visual-studio - .Net Framework 4.8 是否与 Visual Studio 2017 兼容

c# - 为什么 RuntimeMethodInfo.Invoke 没有出现在我的 Visual Studio 调试器调用堆栈中?

c++ - Visual Studio C++ "Multithreaded Debug DLL"与 "Multithreaded DLL"