# Can't get the themes to work

**URL:** <https://discourse.nodered.org/t/cant-get-the-themes-to-work/52713>\
**Category:** General\
**Created:** [25 October 2021 14:50 UTC](https://discourse.nodered.org/t/cant-get-the-themes-to-work/52713 "2021-10-25T14:50:28Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![OriolFM](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/oriolfm/32/30710_2.png) [@OriolFM](https://discourse.nodered.org/u/OriolFM)\
**Post date:** [25 October 2021 14:50 UTC](https://discourse.nodered.org/t/cant-get-the-themes-to-work/52713/1 "2021-10-25T14:50:29Z")

</div>

I had a node-red install on a windows server with the Themes working properly. Due to the tendency of the Windows server to reboot whenever it needs updating (and not restarting node-red server), we decided to move those flows to another node-red server we have, which currently uses the eye-searing white theme.

Steps I did were as follow: I did an SSH into the server, changed to the /.node-red/ directory and ran:

```auto
npm install @node-red-contrib-themes/midnight-red

```

I can see it created a folder with that name inside of /node-red/node-modules.

I changed settings.js to look like this, as per the instructions

```auto
editorTheme: {
    theme: "midnight-red",
    projects: {
        enabled: false
    }
}

```

But after restarting the server and resetting the browser cache, nothing happens, and loads the usual white UI.

If I try to install it again, I get an npm ERR! code EINVALIDTAGNAME

> Invalid tag name ""~"0.3.1": Tags may not have characters that encodeURIComponent encodes.

If I try to install only midnight-red, I get the same problem.

I'll be very grateful for any ideas.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 October 2021 15:20 UTC](https://discourse.nodered.org/t/cant-get-the-themes-to-work/52713/2 "2021-10-25T15:20:56Z")

</div>

What versions of npm and nodejs are you using? That sounds like a bug that was in a superseded version of npm.

Also what version of node-red and what OS?

Have a look in `package.json` and look for the line for the theme, what does it show?

**[Edit]** Also post the startup log for node-red please that you see when you start it in a terminal.

---

<div class="post-metadata">

**Author:** ![OriolFM](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/oriolfm/32/30710_2.png) [@OriolFM](https://discourse.nodered.org/u/OriolFM)\
**Post date:** [26 October 2021 07:16 UTC](https://discourse.nodered.org/t/cant-get-the-themes-to-work/52713/3 "2021-10-26T07:16:50Z")

</div>

Thanks for the reply!

I made sure the npm and node.js were running the last versions, but it seems like node-red was running an older version.

Generally, I update the packages from the "manage palette" dialog, and I didn't see the option to update node-red, so I hadn't.

I updated it from the command line, and now the theme is working. What I don't get is why themes were working in Windows but not in centOS, with the same node-red version.

Anyway, problem solved, thanks.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 October 2021 09:26 UTC](https://discourse.nodered.org/t/cant-get-the-themes-to-work/52713/4 "2021-10-26T09:26:23Z")

</div>

> [@OriolFM](#):
>
> What I don't get is why themes were working in Windows but not in centOS, with the same node-red version.

Was it the same nodejs and npm version?

---

<div class="post-metadata">

**Author:** ![OriolFM](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/oriolfm/32/30710_2.png) [@OriolFM](https://discourse.nodered.org/u/OriolFM)\
**Post date:** [27 October 2021 09:02 UTC](https://discourse.nodered.org/t/cant-get-the-themes-to-work/52713/5 "2021-10-27T09:02:30Z")

</div>

Today, I'm getting a similar error trying to install the node-red-contrib-opcua node. I go to the palette manager, click install, and I get the following log:

> 2021-10-27T08:54:53.436Z Install : node-red-contrib-opcua 0.2.242
> 
> 2021-10-27T08:54:51.854Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-opcua@0.2.242  
> 2021-10-27T08:54:52.429Z [err] npm  
> 2021-10-27T08:54:52.430Z [err] ERR! code EINVALIDTAGNAME  
> 2021-10-27T08:54:52.434Z [err] npm  
> 2021-10-27T08:54:52.434Z [err] ERR! Invalid tag name ""~"0.3.1": Tags may not have any characters that encodeURIComponent encodes.  
> 2021-10-27T08:54:52.439Z [err]  
> 2021-10-27T08:54:52.439Z [err] npm ERR!  
> 2021-10-27T08:54:52.439Z [err] A complete log of this run can be found in:  
> 2021-10-27T08:54:52.439Z [err] npm  
> 2021-10-27T08:54:52.439Z [err] ERR! /root/.npm/\_logs/2021-10-27T08\_54\_52\_435Z-debug.log  
> 2021-10-27T08:54:52.444Z rc=1

The system is running the following:

- node-red v2.1.2
- node.js v12.22.7
- npm v8.1.1
- centOS v8.4-1.2105.el8.noarch

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [27 October 2021 09:17 UTC](https://discourse.nodered.org/t/cant-get-the-themes-to-work/52713/6 "2021-10-27T09:17:36Z")

</div>

Can you post your package.json please?

Edit: did you copy the package.json from the other machine by any chance?

---

<div class="post-metadata">

**Author:** ![OriolFM](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/oriolfm/32/30710_2.png) [@OriolFM](https://discourse.nodered.org/u/OriolFM)\
**Post date:** [27 October 2021 10:17 UTC](https://discourse.nodered.org/t/cant-get-the-themes-to-work/52713/7 "2021-10-27T10:17:43Z")

</div>

I did not copy the package.json from the other machine. this is the package.json:

```auto
{
    "name": "node-red-project",
    "description": "A Node-RED Project",
    "version": "0.0.1",
    "private": true,
    "dependencies": {
        "@node-red-contrib-themes/theme-collection": "^2.1.1",
        "node-red-contrib-calc": "~1.0.5",
        "node-red-contrib-counter": "~0.1.6",
        "node-red-contrib-finite-statemachine": "~2.0.0",
        "node-red-contrib-mcprotocol": "~1.2.1",
        "node-red-contrib-moment": "~4.0.0",
        "node-red-contrib-mssql-plus": "~0.7.3",
        "node-red-contrib-rpi-shutdown": "0.0.2",
        "node-red-contrib-s7": "~3.0.0",
        "node-red-contrib-s7comm": "~1.1.6",
        "node-red-contrib-ui-artless-gauge": "~0.3.11",
        "node-red-dashboard": "~3.0.4",
        "node-red-node-mysql": "~0.2.2",
        "node-red-node-rbe": "~0.5.0",
        "node-red-node-smooth": "~0.1.2"
    }
}

```

Eventually, I will import the flows from the Windows machine to have everything in a single machine, but at the moment, each node-red server has its own project.

I checked this "0.3.1" thing. Some time ago, I did some tests importing log files and needed the [tail node](https://flows.nodered.org/node/node-red-node-tail). That node had this version number, and apparently it was causing problems.

Since I didn't use it, I uninstalled it, and then I was able to install the node-red-contrib-opcua 0.2.242 from command line without errors.

However, after installing, node-red crashed hard. I went into command line, and in htop I saw the CPU usage was off the charts (over 90%). Node-red editor was not loading.

I went into node-modules and deleted all the folders from the opc-ua node, and immediately after deleting them, the editor could load in the browser.

I think the server is on top of an ancient burial ground or something.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [27 October 2021 10:36 UTC](https://discourse.nodered.org/t/cant-get-the-themes-to-work/52713/8 "2021-10-27T10:36:35Z")

</div>

Search for 0.3.1 in package-lock.json, perhaps it is wrong in there.

If not then clean the npm cache and try again  
`npm cache clean --force`

---

<div class="post-metadata">

**Author:** ![OriolFM](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/oriolfm/32/30710_2.png) [@OriolFM](https://discourse.nodered.org/u/OriolFM)\
**Post date:** [27 October 2021 12:26 UTC](https://discourse.nodered.org/t/cant-get-the-themes-to-work/52713/9 "2021-10-27T12:26:10Z")

</div>

As I said in one of my previous replies, there was a package with that number, but I was able to uninstall it with the palette manager.

Installing the opc-ua package makes node-red crash, though.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [27 October 2021 14:37 UTC](https://discourse.nodered.org/t/cant-get-the-themes-to-work/52713/10 "2021-10-27T14:37:24Z")

</div>

> [@OriolFM](#):
>
> Installing the opc-ua package makes node-red crash, though.

Do you mean you fixed the 0.3.1 problem but now you have a different problem? If so then best to start a new thread with that.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [26 December 2021 14:37 UTC](https://discourse.nodered.org/t/cant-get-the-themes-to-work/52713/11 "2021-12-26T14:37:42Z")

</div>

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