Node-red Theme install does not work

Hello I´m trying to use themes on node-red but it does not work.

My setup:

cd /mnt/dietpi_userdata/node-red
npm install @node-red-contrib-themes/theme-collection

Edit the settings.js

root@DietPi:/mnt/dietpi_userdata/node-red# vi settings.js


editorTheme: {
theme: “dark”
},

and restart node-red via #service node-red restart

But the theme don´t work.

Welcome to our community.

I guess installation would need to be done as user nodered

cd /mnt/dietpi_userdata/node-red
sudo -u nodered npm i @node-red-contrib-themes/theme-collection

Inside settings.js you added a new block? Or did you used the existing block?

    editorTheme: {
        /** The following property can be used to set a custom theme for the editor.
         * See https://github.com/node-red-contrib-themes/theme-collection for
         * a collection of themes to chose from.
         */
        theme: "dark",

        /** To disable the 'Welcome to Node-RED' tour that is displayed the first
         * time you access the editor for each release of Node-RED, set this to false
         */
        //tours: false,

        palette: {
            /** The following property can be used to order the categories in the editor
             * palette. If a node's category is not in the list, the category will get
             * added to the end of the palette.
             * If not set, the following default order is used:
             */
            //categories: ['subflows', 'common', 'function', 'network', 'sequence', 'parser', 'storage'],
        },

        projects: {
            /** To enable the Projects feature, set this value to true */
            enabled: false,
            workflow: {
                /** Set the default projects workflow mode.
                 *  - manual - you must manually commit changes
                 *  - auto - changes are automatically committed
                 * This can be overridden per-user from the 'Git config'
                 * section of 'User Settings' within the editor
                 */
                mode: "manual"
            }
        },

I´ve installed the theme-collection as “nodered” user as suggested.

Is the File mnt/dietpi_userdata/node-red/settings.js the correct file ?

I tried the Setup as new block (copied from this thread) and as edit of the existing block. Both attempts does not work.

Thanks for your help.

I´m new to dietpi and a look in the nodered web interface says it runs Version 1.3.7 Maintenance Release. Themes works from version 2.x, so is this the issue ? Why do dietpi install this old version ?

We don’t install a specific version. We just run sudo -u nodered npm i --no-audit node-red. On my test system I get 3.0.2: Maintenance Release

You could have filled the issue template at the beginning. At least this would have given some more information on your system

Sorry, here are some information from my system:

Required Information

  • DietPi version

G_DIETPI_VERSION_CORE=8
G_DIETPI_VERSION_SUB=9
G_DIETPI_VERSION_RC=2
G_GITBRANCH=‘master’
G_GITOWNER=‘MichaIng’

  • Distro version | bullseye 0
  • Kernel version | Linux DietPi 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64 GNU/Linux
  • SBC model | RPi 4 Model B (aarch64)

When I use # sudo -u nodered npm i --no-audit node-red

I get the following Messages:

root@DietPi:~# sudo -u nodered npm i --no-audit node-red
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /root/node_modules/node-red
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/root/node_modules/node-red'
npm ERR! [Error: EACCES: permission denied, mkdir '/root/node_modules/node-red'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/root/node_modules/node-red'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /mnt/dietpi_userdata/node-red/.npm/_logs/2022-10-18T09_15_20_397Z-debug-0.log

I tried to use the command as root and the Release shown in the WebInterface ist now: 3.0.2: Maintenance Release. Now the dark Theme is working ! :grinning: thank you very much !

Ahmmmm this would need to have been done from /mnt/dietpi_userdata/node-red sub directory and not root user home. Of course you had permission issues there.

Oh, my fault :no_mouth:

i tried:

root@DietPi:/mnt/dietpi_userdata/node-red# sudo -u nodered npm i --no-audit node-red

up to date in 2s

40 packages are looking for funding
run npm fund for details

Have I do something to fix my fault or is it okay ?

let’s the root user home directory

ls -la /root
root@DietPi:~# ls -la
total 264
drwx------   7 root root   4096 Oct 18 10:13 .
drwxr-xr-x  18 root root   4096 Oct 16 18:43 ..
-rw-------   1 root root   5350 Oct 18 14:35 .bash_history
-rw-r--r--   1 root root    571 Apr 10  2021 .bashrc
drwxr-xr-x   3 root root   4096 Oct 18 10:13 .cache
drwx------   3 root root   4096 Oct 18 08:27 .config
-rw-r--r--   1 root root    254 Oct 18 14:35 .influx_history
drwxr-xr-x   4 root root   4096 Oct 18 06:51 .npm
-rw-r--r--   1 root root    161 Jul  9  2019 .profile
drwxr-xr-x   2 root root   4096 Oct 17 13:15 .ssh
drwxr-xr-x 250 root root  12288 Oct 18 10:13 node_modules
-rw-r--r--   1 root root 207099 Oct 18 10:14 package-lock.json
-rw-r--r--   1 root root     53 Oct 18 10:14 package.json