I am not able to attach debugger to the already running NodeJS web app.
Following are my VSCode launching configurations:
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach",
"port": 3001
},
I am getting following error message:
Cannot connect to runtime process (reason: This socket has been ended by the other party).
Now, when I add protocol : inspector
in the above configuration, it shows me the following error message:
Ensure Node was launched with --inspect. Cannot connect to runtime process, timeout after 10000 ms
I am currently using v8.6.0 version of NodeJS
Following are my configuration in package.json >> scripts:
"scripts": {
"start": "npm run build && npm run watch --inspect",
"build": "npm run build-sass && npm run build-ts && npm run tslint && npm run copy-static-assets",
"serve": "nodemon dist/server.js",
"watch": "concurrently -k -p \"[{name}]\" -n \"Sass,TypeScript,Node\" -c \"yellow.bold,cyan.bold,green.bold\" \"npm run watch-sass\" \"npm run watch-ts\" \"npm run serve\"",
"test": "jest --forceExit",
"build-ts": "tsc",
"watch-ts": "tsc -w",
"build-sass": "node-sass src/public/css/main.scss dist/public/css/main.css",
"watch-sass": "node-sass -w src/public/css/main.scss dist/public/css/main.css",
"tslint": "tslint -c tslint.json -p tsconfig.json",
"copy-static-assets": "node copyStaticAssets.js",
"debug": "npm run build && npm run watch-debug",
"serve-debug": "nodemon --inspect dist/server.js",
"watch-debug": "concurrently -k -p \"[{name}]\" -n \"Sass,TypeScript,Node\" -c \"yellow.bold,cyan.bold,green.bold\" \"npm run watch-sass\" \"npm run watch-ts\" \"npm run serve-debug\""
},
Ensure Node was launched with --inspect
I think you need to run that with the--inspect
flag.npm start --inspect
? Alternatively,node bin/www --inspect