# Settings file not found on debugging with vscode

**URL:** https://discourse.nodered.org/t/settings-file-not-found-on-debugging-with-vscode/42447
**Category:** Developing Nodes
**Created:** [11 March 2021 07:23 UTC](https://discourse.nodered.org/t/settings-file-not-found-on-debugging-with-vscode/42447 "2021-03-11T07:23:22Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![DenisMtfl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/denismtfl/32/39115_2.png) [@DenisMtfl](https://discourse.nodered.org/u/DenisMtfl)
#### Post date: [11 March 2021 07:23 UTC](https://discourse.nodered.org/t/settings-file-not-found-on-debugging-with-vscode/42447/1 "2021-03-11T07:23:22Z")

</div>

Hey i have started a debug session with vscode.

My launch.json look likes the following. And when i start to debug it cannot found the settings file. But why there is an settings next to red.js !?

```auto
{
    "version": "0.2.0",
    "configurations": [        
       {
           "type": "node",
           "request": "launch",
           "name": "Launch Program",
           "skipFiles": [
               "<node_internals>/**"
           ],
           "env": { "NODE_ENV": "development" },
           "preLaunchTask": "npm: build-dev",
           "program": "${workspaceFolder}\\packages\\node_modules\\node-red\\red.js"
       }
    ]
 }

```

> [nodemon] 2.0.6  
> Gruntfile.js:537  
> [nodemon] to restart at any time, enter `rs`  
> Gruntfile.js:537  
> [nodemon] watching path(s): packages\node\_modules\*\*\*  
> Gruntfile.js:537  
> [nodemon] watching extensions: js,html,json  
> Gruntfile.js:537  
> [nodemon] starting `node packages/node_modules/node-red/red.js -V`  
> Gruntfile.js:537  
> **\> Error loading settings file: \Users\denis.node-red\settings.js**  
> packages/node\_modules/node-red/red.js:139  
> [nodemon] clean exit - waiting for changes before restart  
> Gruntfile.js:537

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [11 March 2021 07:55 UTC](https://discourse.nodered.org/t/settings-file-not-found-on-debugging-with-vscode/42447/2 "2021-03-11T07:55:59Z")

</div>

Are you running from SRC or NPM install?

---

<div class="post-metadata">

### Author: ![DenisMtfl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/denismtfl/32/39115_2.png) [@DenisMtfl](https://discourse.nodered.org/u/DenisMtfl)
#### Post date: [11 March 2021 08:03 UTC](https://discourse.nodered.org/t/settings-file-not-found-on-debugging-with-vscode/42447/3 "2021-03-11T08:03:45Z")

</div>

from git src

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [11 March 2021 08:11 UTC](https://discourse.nodered.org/t/settings-file-not-found-on-debugging-with-vscode/42447/4 "2021-03-11T08:11:35Z")

</div>

Ok, so I initially installed from NPM & ran `node-red` which creates `c:\users\user\.node-red` (though I am sure that should work running from src)

I note you have preLaunchTask set (so you probably got your original vscode settings from one of my earlier posts) but did you also add the entry to tasks.json?

```auto
{
    "version": "2.0.0",
    "tasks": [
         {
			"type": "npm",
			"script": "build-dev",
			"group": "build",
			"problemMatcher": [],
			"label": "npm: build-dev",
			"detail": "build-dev"
         }
    ]
}

```

And when you hit F5 does it run the build pre-task?

Lastly, paste a copy of the debug output (from Pressing F5 to running)

---

<div class="post-metadata">

### Author: ![DenisMtfl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/denismtfl/32/39115_2.png) [@DenisMtfl](https://discourse.nodered.org/u/DenisMtfl)
#### Post date: [11 March 2021 08:24 UTC](https://discourse.nodered.org/t/settings-file-not-found-on-debugging-with-vscode/42447/5 "2021-03-11T08:24:44Z")

</div>

So i have this launch.json and now its running, but is it okay?

```auto
{
    "version": "0.2.0",
    "configurations": [
     
      {
        "type": "node",
        "request": "launch",
        "name": "Launch Node-red",
        "program": "${workspaceFolder}\\packages\\node_modules\\node-red\\red.js",
        "runtimeArgs": ["--preserve-symlinks", "--experimental-modules"],
        "env": {
          "NO_UPDATE_NOTIFIER": "1"
        },
        "args": ["-s", "${workspaceFolder}\\packages\\node_modules\\node-red\\settings.js"]
      },
      {
        "type": "node",
        "request": "launch",
        "name": "Debug Current File",
        "program": "${file}"
      },
      { "type": "node", "request": "attach", "name": "Attach to Process", "processId": "${command:PickProcess}" } 
      
    ]
  }

```

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [11 March 2021 08:32 UTC](https://discourse.nodered.org/t/settings-file-not-found-on-debugging-with-vscode/42447/6 "2021-03-11T08:32:15Z")

</div>

Not really. That is using the SRC `settings.js` - that shouldnt be used or modified.

What you need to understand is, when node-red is ran for the first time, it creates `c:\users\user\.node-red` folder with a flows file and settings file etc.

Also, that version of `launch.json` doesnt build node-red src so you'd have to run `npm: build-dev` every time manually before hitting F5.

If you use the first version and answer my prev questions I will try to help.

> [@Steve-Mcl](#):
>
> And when you hit F5 does it run the build pre-task?
> 
> Lastly, paste a copy of the debug output (from Pressing F5 to running)

Also, can i ask, what is your intent? is this for modifying node-red core or for debugging function nodes you have written in node-red editor or for debugging own custom node development?

---

<div class="post-metadata">

### Author: ![DenisMtfl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/denismtfl/32/39115_2.png) [@DenisMtfl](https://discourse.nodered.org/u/DenisMtfl)
#### Post date: [11 March 2021 08:45 UTC](https://discourse.nodered.org/t/settings-file-not-found-on-debugging-with-vscode/42447/7 "2021-03-11T08:45:49Z")

</div>

hm okay i will try.

my intent is to develop an new node - btw. is there an extension in vscode that will intellisense the "customnode.js" from my newly created node ?

**Example:**  
in the example node if creating a new node there is a line like  
`msg.payload = msg.payload.toUpperCase();`  
Here i find its very exhausting to know every method? But its complicated because payload is "any" !?  
So i'm searching for an intellisense extension?!

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [11 March 2021 08:57 UTC](https://discourse.nodered.org/t/settings-file-not-found-on-debugging-with-vscode/42447/8 "2021-03-11T08:57:38Z")

</div>

> [@DenisMtfl](#):
>
> So i'm searching for an intellisense extension?!

There is not. payload can be anything by design.

however, if you mean inteliisense for things like `node` and `javascript` function then use jsdoc to instruct vscode of the type...

```auto
/** @type {string} */ var payload = msg.payload */ 

```

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/1/b1d51d5f7c4efbfd2a19ba91832ab4a53d641460.png)

* * *

> [@DenisMtfl](#):
>
> my intent is to develop an new node

Ok, so you dont need to run node-red from src.

all you need to do is...

- follow the normal NPM install from node-red docs
- run node-red once (i.e. `node-red`) to generate the flows and settings files
- use [this guide](https://discourse.nodered.org/t/how-to-proper-debug-custom-node/9308/13) to run node-red in vscode

---

<div class="post-metadata">

### Author: ![DenisMtfl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/denismtfl/32/39115_2.png) [@DenisMtfl](https://discourse.nodered.org/u/DenisMtfl)
#### Post date: [11 March 2021 09:03 UTC](https://discourse.nodered.org/t/settings-file-not-found-on-debugging-with-vscode/42447/9 "2021-03-11T09:03:31Z")

</div>

Okay thanks!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [10 May 2021 09:04 UTC](https://discourse.nodered.org/t/settings-file-not-found-on-debugging-with-vscode/42447/10 "2021-05-10T09:04:11Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
