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;








0















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.










share|improve this question




























    0















    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.










    share|improve this question
























      0












      0








      0








      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.










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 25 at 7:36









      KrishnaKrishna

      3861517




      3861517






















          1 Answer
          1






          active

          oldest

          votes


















          1














          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.






          share|improve this answer























            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
            );



            );













            draft saved

            draft discarded


















            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









            1














            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.






            share|improve this answer



























              1














              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.






              share|improve this answer

























                1












                1








                1







                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.






                share|improve this answer













                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 25 at 7:45









                eoleol

                3,10931629




                3,10931629





























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript