# Problem running/debugging node-red in Visual Studio Code

**URL:** <https://discourse.nodered.org/t/problem-running-debugging-node-red-in-visual-studio-code/2984>\
**Category:** Core Development\
**Created:** [9 September 2018 13:53 UTC](https://discourse.nodered.org/t/problem-running-debugging-node-red-in-visual-studio-code/2984 "2018-09-09T13:53:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nithinbandaru1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nithinbandaru1/32/2513_2.png) [@nithinbandaru1](https://discourse.nodered.org/u/nithinbandaru1)\
**Post date:** [9 September 2018 13:53 UTC](https://discourse.nodered.org/t/problem-running-debugging-node-red-in-visual-studio-code/2984/1 "2018-09-09T13:53:32Z")

</div>

Hi,

I have written few flows that have many function in it and I am willing to debug them using visual studio code.

I have followed the instructions provided in GitHub for developers.

**I also have an local install done using npm. Which is running fine with no errors except one I menctioned in [https://discourse.nodered.org/t/typeerror-ctx-keys-is-not-a-function-at-exportcontextstore/2942](https://discourse.nodered.org/t/typeerror-ctx-keys-is-not-a-function-at-exportcontextstore/2942).**  
**strong text**

Now I **stopped my locally installed node red** and **tried to run it with code-base from GitHub** using vs code.

Every thing looks fine but I am getting error that **ui\_base is missing**. But I am **not getting the same error when I am running locally installed one using npm**.

**Error details:**

> 9 Sep 19:32:56 - [info] Waiting for missing types to be registered:  
> 9 Sep 19:32:56 - [info] - ui\_base

**Q1.** I think that node-modules that I download will be saved in the user folder and not in the code-base folder inside AppData. So irrespective of running code base form any folder node-red should not be showing this error. Am I missing anything here?

**Q2.** I am not able to debug node-red form visual studio code. I mean though it starts node-red it will never hit break-point. I don't have much knowledge about how to debug in nodejs with vs(from .net background). I am thinking the build is done in release mode and so debugger points are not loaded. Or is there something I am missing here?

_Any help from you guys will be great because it will make my life easy for debugging my flows._

_With regards,_  
_Nithin B._

---

<div class="post-metadata">

**Author:** ![nithinbandaru1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nithinbandaru1/32/2513_2.png) [@nithinbandaru1](https://discourse.nodered.org/u/nithinbandaru1)\
**Post date:** [9 September 2018 20:32 UTC](https://discourse.nodered.org/t/problem-running-debugging-node-red-in-visual-studio-code/2984/2 "2018-09-09T20:32:21Z")

</div>

For **Q2** I found that it is pointing to /red/red.js(By default), Changed to red.js file and working fine.

**Note:** I am able to use Attach option and run and I am successfully able to debug. But my Idea is to run using source code.

When I am running I am facing **Q2** problem and I can see that there is a function to validate the availability modules. I didn't dig more into it.I think the path where it is looking for modules is not correct.

Because of this I cant see my function nodes not loaded in Loaded scripts tab of vs code --\> which I can see when I attach process to node-red in AppData folder.
