How to debug multiple node projects in vscode debugger?How do I debug Node.js applications?How to customize the tab-to-space conversion factor when using Visual Studio Code?How do you format code in Visual Studio Code (VSCode)What is the proper way to debug an npm script using vscode?VSCode - How to debug a Node program that starts its own debugger, using a launch configuration?VSCode node debuggerVScode debugger not stopping on breakpoints while debugging a remote node serverCannot find Node process using VSCode DebuggerHow do you debug a botpress-module installed in bot (botpress) in vs-code?Debugging NodeJS app locally in Chrome and VSCode
How to parse 「場合でも」
How to check what is breaking automatic updates kernel when use apt upgrade or dist-upgrade?
Constitutionality of U.S. Democratic Presidential Candidate's Supreme Court Suggestion
How can I bring back a dead main character without cliches?
Define division by zero as infinity
Story about a space war, and a human prisoner of war captured by alien enemy
Is "Busen" just the area between the breasts?
Should I include an appendix for inessential, yet related worldbuilding to my story?
Can humans ever directly see a few photons at a time? Can a human see a single photon?
Improve appearance of the table in Latex
How do you pronounce the letter "t" before "h"?
How does DC work with natural 20?
Do I have any obligations to my PhD supervisor's requests after I have graduated?
Methodology: Writing unit tests for another developer
"Correct me if I'm wrong"
Count All Possible Unique Combinations of Letters in a Word
Did the CIA blow up a Siberian pipeline in 1982?
King or Queen-Which piece is which?
Explain why a line can never intersect a plane in exactly two points.
`-` in tar xzf -
Designing a magic-compatible polearm
Music theory behind A chord in the key of G
Is there a difference between an NFC and RFID chip?
Why does independence imply zero correlation?
How to debug multiple node projects in vscode debugger?
How do I debug Node.js applications?How to customize the tab-to-space conversion factor when using Visual Studio Code?How do you format code in Visual Studio Code (VSCode)What is the proper way to debug an npm script using vscode?VSCode - How to debug a Node program that starts its own debugger, using a launch configuration?VSCode node debuggerVScode debugger not stopping on breakpoints while debugging a remote node serverCannot find Node process using VSCode DebuggerHow do you debug a botpress-module installed in bot (botpress) in vs-code?Debugging NodeJS app locally in Chrome and VSCode
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have two separate node projects in two separate workspaces. I am trying to debug the projects with vscode debugger but I can only debug one project at a time. If I try to launch the debugger for the second project after starting the debugger for the first one, vscode debuggers restarts the first project again.
I have gone through various tutorials and vscode documentation for debugging and vscode debugging for nodejs but to no avail. Following are the launch configurations for both projects.
Project 1(fort):
"version": "0.2.0",
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch fort",
"runtimeExecutable": "npm",
"runtimeArgs": [
"start"
],
"envFile": "$workspaceFolder/.env",
"port": 9229
]
Value for scripts
attribute in package.json
"scripts":
"start": "node --inspect app.js",
"test": "echo "Error: no test specified" && exit 1"
Project 2(User Management):
"version": "0.2.0",
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch User Management",
"runtimeExecutable": "npm",
"runtimeArgs": [
"start"
],
"envFile": "$workspaceFolder/.env",
"port": 9229
]
Value for scripts
attribute in package.json
"scripts":
"start": "node --inspect server.js",
"test": "echo "Error: no test specified" && exit 1"
As per my understanding after reading the vscode docs, if I have separate launch.json
present in the .vscode
folder of the workspaces that particular configuration will be used to launch the debugger.
Perhaps I am missing something in the docs but I have invested enough time and have been unable to figure out a solution.
node.js visual-studio-code vscode-settings vscode-debugger
add a comment |
I have two separate node projects in two separate workspaces. I am trying to debug the projects with vscode debugger but I can only debug one project at a time. If I try to launch the debugger for the second project after starting the debugger for the first one, vscode debuggers restarts the first project again.
I have gone through various tutorials and vscode documentation for debugging and vscode debugging for nodejs but to no avail. Following are the launch configurations for both projects.
Project 1(fort):
"version": "0.2.0",
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch fort",
"runtimeExecutable": "npm",
"runtimeArgs": [
"start"
],
"envFile": "$workspaceFolder/.env",
"port": 9229
]
Value for scripts
attribute in package.json
"scripts":
"start": "node --inspect app.js",
"test": "echo "Error: no test specified" && exit 1"
Project 2(User Management):
"version": "0.2.0",
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch User Management",
"runtimeExecutable": "npm",
"runtimeArgs": [
"start"
],
"envFile": "$workspaceFolder/.env",
"port": 9229
]
Value for scripts
attribute in package.json
"scripts":
"start": "node --inspect server.js",
"test": "echo "Error: no test specified" && exit 1"
As per my understanding after reading the vscode docs, if I have separate launch.json
present in the .vscode
folder of the workspaces that particular configuration will be used to launch the debugger.
Perhaps I am missing something in the docs but I have invested enough time and have been unable to figure out a solution.
node.js visual-studio-code vscode-settings vscode-debugger
add a comment |
I have two separate node projects in two separate workspaces. I am trying to debug the projects with vscode debugger but I can only debug one project at a time. If I try to launch the debugger for the second project after starting the debugger for the first one, vscode debuggers restarts the first project again.
I have gone through various tutorials and vscode documentation for debugging and vscode debugging for nodejs but to no avail. Following are the launch configurations for both projects.
Project 1(fort):
"version": "0.2.0",
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch fort",
"runtimeExecutable": "npm",
"runtimeArgs": [
"start"
],
"envFile": "$workspaceFolder/.env",
"port": 9229
]
Value for scripts
attribute in package.json
"scripts":
"start": "node --inspect app.js",
"test": "echo "Error: no test specified" && exit 1"
Project 2(User Management):
"version": "0.2.0",
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch User Management",
"runtimeExecutable": "npm",
"runtimeArgs": [
"start"
],
"envFile": "$workspaceFolder/.env",
"port": 9229
]
Value for scripts
attribute in package.json
"scripts":
"start": "node --inspect server.js",
"test": "echo "Error: no test specified" && exit 1"
As per my understanding after reading the vscode docs, if I have separate launch.json
present in the .vscode
folder of the workspaces that particular configuration will be used to launch the debugger.
Perhaps I am missing something in the docs but I have invested enough time and have been unable to figure out a solution.
node.js visual-studio-code vscode-settings vscode-debugger
I have two separate node projects in two separate workspaces. I am trying to debug the projects with vscode debugger but I can only debug one project at a time. If I try to launch the debugger for the second project after starting the debugger for the first one, vscode debuggers restarts the first project again.
I have gone through various tutorials and vscode documentation for debugging and vscode debugging for nodejs but to no avail. Following are the launch configurations for both projects.
Project 1(fort):
"version": "0.2.0",
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch fort",
"runtimeExecutable": "npm",
"runtimeArgs": [
"start"
],
"envFile": "$workspaceFolder/.env",
"port": 9229
]
Value for scripts
attribute in package.json
"scripts":
"start": "node --inspect app.js",
"test": "echo "Error: no test specified" && exit 1"
Project 2(User Management):
"version": "0.2.0",
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch User Management",
"runtimeExecutable": "npm",
"runtimeArgs": [
"start"
],
"envFile": "$workspaceFolder/.env",
"port": 9229
]
Value for scripts
attribute in package.json
"scripts":
"start": "node --inspect server.js",
"test": "echo "Error: no test specified" && exit 1"
As per my understanding after reading the vscode docs, if I have separate launch.json
present in the .vscode
folder of the workspaces that particular configuration will be used to launch the debugger.
Perhaps I am missing something in the docs but I have invested enough time and have been unable to figure out a solution.
node.js visual-studio-code vscode-settings vscode-debugger
node.js visual-studio-code vscode-settings vscode-debugger
asked Mar 25 at 7:36
KrishnaKrishna
3861517
3861517
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You need to use two separate ports for the debuggers to attach, e.g:
Project 1:
"version": "0.2.0",
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch fort",
"runtimeExecutable": "npm",
"runtimeArgs": [
"start"
],
"envFile": "$workspaceFolder/.env",
"port": 9228
]
Or if you want to attach to the process:
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9228
Start node inspect on port 9228:
node --inspect=9228 index.js
You can keep the defaults for the second project.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55333105%2fhow-to-debug-multiple-node-projects-in-vscode-debugger%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You need to use two separate ports for the debuggers to attach, e.g:
Project 1:
"version": "0.2.0",
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch fort",
"runtimeExecutable": "npm",
"runtimeArgs": [
"start"
],
"envFile": "$workspaceFolder/.env",
"port": 9228
]
Or if you want to attach to the process:
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9228
Start node inspect on port 9228:
node --inspect=9228 index.js
You can keep the defaults for the second project.
add a comment |
You need to use two separate ports for the debuggers to attach, e.g:
Project 1:
"version": "0.2.0",
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch fort",
"runtimeExecutable": "npm",
"runtimeArgs": [
"start"
],
"envFile": "$workspaceFolder/.env",
"port": 9228
]
Or if you want to attach to the process:
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9228
Start node inspect on port 9228:
node --inspect=9228 index.js
You can keep the defaults for the second project.
add a comment |
You need to use two separate ports for the debuggers to attach, e.g:
Project 1:
"version": "0.2.0",
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch fort",
"runtimeExecutable": "npm",
"runtimeArgs": [
"start"
],
"envFile": "$workspaceFolder/.env",
"port": 9228
]
Or if you want to attach to the process:
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9228
Start node inspect on port 9228:
node --inspect=9228 index.js
You can keep the defaults for the second project.
You need to use two separate ports for the debuggers to attach, e.g:
Project 1:
"version": "0.2.0",
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch fort",
"runtimeExecutable": "npm",
"runtimeArgs": [
"start"
],
"envFile": "$workspaceFolder/.env",
"port": 9228
]
Or if you want to attach to the process:
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9228
Start node inspect on port 9228:
node --inspect=9228 index.js
You can keep the defaults for the second project.
answered Mar 25 at 7:45
eoleol
3,10931629
3,10931629
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55333105%2fhow-to-debug-multiple-node-projects-in-vscode-debugger%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown