Why is the flow file in AppData\Roaming\SPB_Data on my Windows PC?

I found that the ".node-red" folder on one of my Windows PC is in: "C:\Users\xxxx\AppData\Roaming\SPB_Data" instead of the normal "C:\Users\xxxx".

I don't understand why this has happened.
Can I change this location to "C:\Users\xxxx"?

This is what I see when starting node-red:

  • [info] Node-RED version: v1.0.2
  • [info] Node.js version: v13.1.0
  • [info] Windows_NT 10.0.18362 x64 LE
  • [info] Loading palette nodes
  • [info] Settings file : C:\Users\xxxx\AppData\Roaming\SPB_Data.node-red\settings.js
  • [info] Context store : 'default' [module=memory]
  • [info] User directory : C:\Users\xxxx\AppData\Roaming\SPB_Data.node-red
  • [warn] Projects disabled : editorTheme.projects.enabled=false
  • [info] Flows file : C:\Users\xxxx\AppData\Roaming\SPB_Data.node-red\flows_PC-xxxx.json

Maybe some environment variables have been changed on your system.

I would check the values of HOME, HOMEPATH and USERPROFILE.

Thanks for your suggestion!
Indeed, the HOME variable is: C:\Users\xxx\AppData\Roaming\SPB_Data.
I have read that this variable is not set by default.
I have no idea which tool has set this variable.

By default it should be set by the OS.
I think you can just delete the entry in your environment dialog, logout/login and it should be working again.

As another solution, you can explicitly pass the location of the workspace when starting Node-RED. Just pass the path with the parameter -u path/to/workspace.

I deleted the HOME enviroment variable and restarted Node-RED.
Now indeed it uses the default path.

Thank you very much for your explanation and help!

You're welcome.

But you should investigate which program had changed that variable so it won't happen again.

Yes indeed.

The oldest created folder in "C:\Users\xxxx\AppData\Roaming\SPB_Data" is "cdssetup".
This folder is created by Orcad in 2017. So Orcad is a good candidate.
I just checked that Orcad is still working after removing the HOME variable.
I will keep an eye on the HOME variable.

Sorry to bring this thread back from the dead. I have just run into this same problem where my home environment variable was set to C:\Users\xxx\AppData\Roaming\SPB_Data. I am fairly certain that setting up windows subsystem linux (WSL) caused my home variable to be set to this location. I also have some data in this folder related to Orcad, but I believe that this is simply because Orcad copied these files over to the new home variable location on startup, not that Orcad changed the home variable. I know it was a few years ago but can you remember if you also had recently set up WSL?

Edit: it may actually be a combination of factors. The answer to this post on stack-exchange claims that Cadence Allegro may edit the HOME variable, though not exactly to the location we are seeing: Can't change Cygwin Home Directory from /SPB_Data - Stack Overflow

Anyway, just putting this here to try to help resolve the mystery. I was able to just set my HOME variable back to the default and have had no problems.