Reputation: 15153
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
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