Settings.js issue after upgrading to 2.2.2

Just upgraded from 2.1.x to 2.2.2 on RaspberryPi using the script on Node-Red site. Upgrade went normally except at the end, I got a message informing me that my settings.js did not match the format of the new settings.js format located in /usr/lib/node_modules/node-red/ folder. After inspecting and saving a copy of my original settings.js file, I made the needed changes in the new settings.js file and copied it to my /home//.node-red folder. Restarted node-red. When I go to my web browser (MS Edge) and pull up the NR editor, it starts to load but then hangs on "Loading Nodes 35/87". I tried a few things to no avail. I suspect it may have something to do with how I have "External Modules" configured, but not sure. In mean time, I installed my old settings.js

What is considered an "External Module"? Is node-red-contrib-sun-position such a module?

I am a new user so unable to upload my settings.js files, but would appreciate help. Thanks.
Running node.js v 14.19

I've just bumped up your level so you can try uploading the settings.js file BUT before you do, try starting nee-red with node-red --safe and see if it starts.

It's possible you have a syntax error in the file.

You don't need to make any changes. The message is to inform you that there are additional features in the new source file. Did you get the impression from the message that it was necessary to update it? I believe the wording is

Your settings.js file is different from the latest defaults.
You may wish to run
    diff -y --suppress-common-lines /usr/lib/node_modules/node-red/settings.js <your file>
to compare them.

@Colin, you are correct in the exact message I was given. It is just after I examined both old and new settings.js files that I thought the prudent thing to do would be to get my settings.js file closer to the current default file. If you are implying that my old settings.js file is still OK, then I will leave well enough alone and keep trucking on. Many thanks for the confirmation.

Your old file should be fine. The purpose in adding the new options is just in case you want to enable the new features.

I would have expected the new stuff to be mostly just comments. Can you post the output of the diff command?

I see the problem, because the settings file was completely re-organised recently the diff is not much short of useless.

What would be more useful would be to be able to see the changes one has made to settings.js in order to apply them to the new file.

@dceejay I am not sure the message as currently shown is particularly useful, and may cause more confusion than help. I don't know what the best thing to do is though.

indeed - folk asked to to be told if they were out of date... so i have done that... I don't know of any automatic diff way that can handle a complete re-org - apart from telling people to go read the upgrade readme/change log... and we know how good people are at that...

ORIGsettings.js.txt (13.0 KB)
NEWsettings.js.txt (20.0 KB)

Attached are my ORIG and NEW settings.js files. Agree most lines are commented out in both files; however, there is something in the NEW file that is preventing my flows from loading. I will look at the change log to see if I can figure out what to enable in the NEW file as going forward; I would assume the intent is for everyone to move to that format settings file.

Thanks to all of you for your time.

Perhaps it would be better just to tell users about the fact that there is a new version and tell them where it is, but also that there is no need to do anything if they don't want to.

Ahh finally you provide what I asked for. You have two lines:

    flowFile: 'flows_RPi4b.json',

and

    nodesDir: '/home/rgl/.node-red/node_modules',

that you used single quotes. Change them to double quotes and see if it works. And make sure they are not ā€˜smartā€™ quotes.

Well I thought the warning did just that. The diff just being a way to see them both at the same time. But yes suggestions always welcome

1 Like

@GasTurbineMan I just tried starting up NR using your newsettings.json and it worked fine for me. This was with an empty flow.

Changed single to double quotes as suggested. Same issue. From within the browser, looking at More Tools->Developer Tools I am seeing the attached error.

Flow load error

I appreciated being told that there were new options. Seemed simple enough to compare the two and add in all the new stuff, no problems at all.

2 Likes

I got my issue resolved. I commented out all lines in the NEW settings that were not in the ORIGINAL. Then one by one would enable each new line that was enabled by default in the NEW file. It turned out to be my

nodesDir: '/home/rgl/.node-red/node_modules',

I believe in the default NEW settings files, it was pointing to a "nodes" directory that I did not have, so with "node_modules" being the closest thing I did have, I put in that. Guess I really did not need anything.

Thanks again for the help - as I did learn several things during this ordeal.

1 Like

You don't need that unless you have manually added extra nodes that you want it to pick up. I am not sure why you had it enabled. It is commented out in the master version on mine at /usr/lib/node_modules/node-red/settings.js

    /** Node-RED scans the `nodes` directory in the userDir to find local node files.
     * The following property can be used to specify an additional directory to scan.
     */
    //nodesDir: '/home/nol/.node-red/nodes',

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