Adding or removing a palette causing ALL palettes to disappear

I'm having an issue. I need to remove a palette and add in another one. However, when I initiate the removal it seems to work as expected. When I reload NR though ALL my installed palettes are gone with only the default ones showing and all my flows broken. Trying to install a new palette causes the same behavior. Any ideas how to resolve this? Setup info:

OS: Debian 10
NR version: 0.20.8
NPM version: 6.9.0

Let me know if more information is needed. Thanks!!

You mentioned your npm version, but what is the version of nodejs? node --version

@afelix - oops, that would have been helpful. 12.4.0

Pretty sure that's the issue. V10 LTS is supported. V12 is not and I've seen others have issues with NR+V12.

1 Like

@Steve-Mcl - Thanks for the info. I'll figure out how to downgrade and try it again. I'll post back if that resolves it. Thanks so much!

No. Node 12 is very stable and I do not know of any issues with it around the core. I have certainly never seen the symptoms described.

@danodemano just to clarify the terminology, the 'palette' is the collection of everything you have installed. The individual things you install are 'modules'.

How are you adding and removing modules from the palette? Using the Manage Palette dialog in the editor or via the command line?

When you have all your modules installed, take a copy of ~/.node-red/package.json. Then, when you install something that removes all of your modules, take another copy of that file. If you can then share those two files with us that would help see what is happening.

1 Like

Thanks for the info on Node 12

Sorry my bad, yes the modules. And I'm using the palette manager via the web UI.

Just did as instructed, and both files can be found below. Though they appear to be identical and the time/date stamp doesn't change.

Before: https://pastebin.com/bRnLWi0j
After: https://pastebin.com/bBQKnX78

Are you using Node-RED on HASSIO?

No, it's a straight Python install of Home Assistant on-top of Debian 10.

I was thinking of instances users have reported problems (on this forum) with node V12 installed (typically I can't find any of them threads as reference). Those issues were with contrib nodes +V12 & assumed since the user was reporting problem with pallete this was related.

I didn't mean to make it seem node red was incompatible with node V12 (even though that's pretty much what I wrote - oops)

Looking at the original package.json there appears to be no record of any installed nodes. When you install a new node npm will remove any nodes not declared in package.json, which explains why they all disappear. How did you install the nodes in the first place?

@Colin - I've been installing them via the palette manager all along. That explains why they get removed though. They are "installed" though and working. Any way to re-populate that file?

First I think you need to find why it is not updating that file. How are you starting node-red? Can you post the output from the node red log when you start it. That is the log with Welcome to node red in it.
Try adding a node via the palette manager and see if it adds it to package.json. Check you are looking in the right file - it is included in the node red log.
If it doesn't get added try by using npm in the command line. Make sure you go into the correct directory first, it is the one where the settings file is unless you are starting node-red in an usual way. Then to install it something like
npm install node-red-contrib-something
Post the output you get from that and again see if it has been added to package.json

How are you starting node-red?

I'm controlling it via the pm2 process manager.

Try adding a node via the palette manager and see if it adds it to package.json.

It doesn't seem to do anything when running in verbose straight from the terminal. It looks like it's adding the package but then does nothing and there isn't anything logged.

If it doesn't get added try by using npm in the command line.

Just tried that too, it says it installed:

root@ha:~# cd .node-red/
root@ha:~/.node-red# npm install node-red-contrib-amazon-echo
npm WARN HASS_Integration_2@0.0.1 No repository field.
npm WARN HASS_Integration_2@0.0.1 No license field.

+ node-red-contrib-amazon-echo@0.1.8
added 2 packages from 2 contributors, removed 22 packages, updated 22 packages, moved 12 

packages and audited 175 packages in 10.916s
found 0 vulnerabilities

It does appear in the package.json too:

{
    "name": "HASS_Integration_2",
    "description": "A Node-RED Project",
    "version": "0.0.1",
    "dependencies": {
        "node-red-contrib-amazon-echo": "^0.1.8"
    },
    "node-red": {
        "settings": {
            "flowFile": "flows_ha.json",
            "credentialsFile": "flows_ha_cred.json"
        }
    }
}

Full log from my testing can be found here: https://pastebin.com/G0c1L9uA

What is the justification for running Node-RED as root?

I need it to use port 80

Have you thought about setting up a reverse proxy on the same machine through Apache or Nginx so you wouldn't have to run node-red as root?

I've thought about it, but don't have the time to mess with it currently. I really need to get this module issue sorted out.

In general, running node-red as root is a bad idea for a ton of different reasons. There's quite a few posts about it on the forum. Even more when exposing it to the wider int{ra,er}net.

I'm well aware of that fact, but as it stands that's a risk I'm willing to take until I have time to sort it out properly. Can we get back to my actual problem please?