Visual Studio Code has recently changed its default debug protocol for the launch type of debug configuration. In the passed, they assumed node’s legacy protocol, however with recent versions of vscode, they try connecting with inspector instead. The attach still prefers the legacy protocol. If you have problem debugging with older nodejs version using launch configuration, where an attach to a running nodejs instance works without problems, you probably stumbled about this. The solution is quite simple. Just embedd the following line in your launch configuration:
“protocol”: “legacy”