MiguelSlv
MiguelSlv

Reputation: 15153

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

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

Upvotes: 3

Views: 3863

Answers (1)

Ridham Tarpara
Ridham Tarpara

Reputation: 6160

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.

Upvotes: 2

Related Questions