(node:11684) [DEP0062] DeprecationWarning: `node --inspect --debug-brk` is deprecated. Please use `node --inspect-brk` instead

限于喜欢 提交于 2019-12-12 19:20:34

问题


I am getting this error running Nodejs from Visual Studio 2017 since i upgrade NodeJs.

Also breakpoints are not working. Any way to fix this?

Note: VS version is 15.5.6 NodeJS version 8.9.4


回答1:


I was having the same issue, and following has worked for me.

1st solution

change in your launch.json from

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

This should work.

2nd solution

In package.json:

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

Then default debug launch configuration for node from latest VS Code:

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

Both have worked for me.



来源:https://stackoverflow.com/questions/48623841/node11684-dep0062-deprecationwarning-node-inspect-debug-brk-is-depre

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!