Hi everybody,
I've installed node-red on my secondary D: drive for some tests and, when running it from this secondary disk, Node-RED creates a "\User\<username>" folder into this drive (e.g. D:\User\Guilherme, whereas Windows is installed on C:\). Taking a look, the default userDir is evaluated from the following expression:
process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE
Here, HOME is not defined (as on Windows, normally) and HOMEPATH is:
HOMEPATH=\Users\Guilherme
So, the node-red folder is actually depending on the working directory of node's executable, which may not always be in the same drive as Windos and the user profile.
There's a HOMEDRIVE env. variable (at least here in my machine) that we could join or concat here, or even drop it out completely, as the USERPROFILE variable correctly contains the drive letter. Another possibility would be to switch to APPDATA or LOCALAPPDATA, where most Windows application store their data.
What do you think? Should I open an issue and/or PR on gitHub?
Thanks!