Settings file path change

Hi, I need to change the setttings.js path. Is this posiblle?
Thanks, Lucas

Hi @LucasPeluso,

I'm not sure how you are starting/running Node RED - but it can be passed various args - one of which is -s, --settings

Hi marcus, i´m running node-red from powershell. The thing is that i don´t know where i can change that path.
Thanks, Lucas

settings.js by default is loaded from ~/.node-red/settings.js (its in the source code)
To change it - you pass it an arg of --settings

Assuming your running the module directly.

node node_modules/node-red/red.js --settings E:/NRSettings/settings.js

Hi Marcus, I think I understand you. I have some doubts. I will explaind you all more detailed.
I´m working with 2 servers. The instalation was made in the .152 but in the server .151 don´t work the node-red. The only disk shared between the servers is the U disk. So I need to change de running path to de U disk.

I copy the .node-red carpet to the U disk.

On the other hand, I have the red.js file in the folder .node-red not in the node_modules/node-red. Is the same?

Then I imagen that the path --settings is the path of the new file that i want to open.

I hope I have made myself understood, since English is not my native language.
Thanks Lucas

Node RED consists of the Node RED install its self (i.e. the Node RED application)
under normal circumstance - this is some global node_modules folder

  • i.e C:\Users\<User>\AppData\Roaming\npm\node_modules

In here is where red.js lives node_modules\node-red\red.js (the Node RED application)

The 2nd location is the users home directory (the person running Node RED)
By default this is : C:\Users\<User>\.node-red and in here is:

  • The persons flow file (flows.json)
  • The persons settings file (settings.js)
  • a few other things

So if you do not provide any argument to red.js it will use defaults:

  • Home being <user>/.node-red
  • Settings being <Home>/settings.js
  • Flows being <Home>/flows.json

And you can override these defaults at runtime with the args I posted.

And just in case your trying to do something fancy - any running instance of Node RED must use their own Home folder - as that is a recipe for disaster if 2 Node RED instances are running with the same Home folder set.

Its also important to note: any user installed Nodes, will be installed into the Home folder Node RED is using

ok, great. I could change the settings.js path.
But it does´t solve my problem.

I what to try to change the userDir.

What would the command be like in this case?

to set the userDir - what I have been referring to as Home :sweat_smile:

red.js --userDir E:/some/Home/location

It is also possible to install Node-RED itself to the U: drive if you want to. It is "just" a node.js app and so can be installed anywhere, it doesn't have to be installed to the global location.

1 Like

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