Install extra node in docker

I am running docker with node red. I try to install: node-red-contrib-tasmota 1.0.0
Only i get an error when i try this to install in nodered [docker running]

2024-12-27T16:41:27.537Z Install : node-red-contrib-tasmota 1.0.0

2024-12-27T16:41:26.979Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-tasmota@1.0.0
2024-12-27T16:41:28.028Z [err] npm
2024-12-27T16:41:28.029Z [err]  WARN
2024-12-27T16:41:28.029Z [err]  config production Use `--omit=dev` instead.
2024-12-27T16:41:29.552Z [err] npm
2024-12-27T16:41:29.552Z [err]  ERR! code EACCES
2024-12-27T16:41:29.552Z [err] npm ERR!
2024-12-27T16:41:29.553Z [err]  syscall open
2024-12-27T16:41:29.553Z [err] npm ERR!
2024-12-27T16:41:29.553Z [err]  path /data/.npm/_cacache/tmp/d9939d6b
2024-12-27T16:41:29.554Z [err] npm ERR! errno -13
2024-12-27T16:41:29.557Z [err] npm ERR! 
2024-12-27T16:41:29.557Z [err] npm
2024-12-27T16:41:29.558Z [err]  ERR! Your cache folder contains root-owned files, due to a bug in
2024-12-27T16:41:29.558Z [err] npm ERR! previous versions of npm which has since been addressed.
2024-12-27T16:41:29.558Z [err] npm 
2024-12-27T16:41:29.558Z [err] ERR! 
2024-12-27T16:41:29.558Z [err] npm ERR! To permanently fix this problem, please run:
2024-12-27T16:41:29.558Z [err] npm ERR!   sudo chown -R 1000:1000 "/data/.npm"
2024-12-27T16:41:29.562Z [err] 
2024-12-27T16:41:29.563Z [err] npm ERR! A complete log of this run can be found in:
2024-12-27T16:41:29.563Z [err] npm ERR!     /data/.npm/_logs/2024-12-27T16_41_27_955Z-debug-0.log
2024-12-27T16:41:29.578Z rc=243

I d not understand teh example npm install like some wiki says.. So please is there a way to install a extra node wit for example a line into my docker compose file?

Or perhaps a other way...

Which nodered version do you run with your docker instance?

I just tested with latest 4.0.8 and it successfully installs:


2024-12-27T18:22:56.675Z Installieren : node-red-contrib-tasmota 1.0.0

2024-12-27T18:22:56.736Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --omit=dev --engine-strict node-red-contrib-tasmota@1.0.0

2024-12-27T18:23:01.078Z [err] npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.

2024-12-27T18:23:01.119Z [err] npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported

2024-12-27T18:23:01.742Z [out]

2024-12-27T18:23:01.742Z [out] added 47 packages in 5s

2024-12-27T18:23:01.757Z rc=0

Aside: Have you tried to run

sudo chown -R 1000:1000 "/data/.npm" in your nodered data folder? As per your error messages indicate?

NR version:

pi@odroidn2:~$ docker info
Client: Docker Engine - Community
 Version:    27.4.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.19.3
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.32.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose


No thing i understand:


pi@odroidn2:~$ cd /opt/nodered
pi@odroidn2:/opt/nodered$ sudo chown -R 1000:1000 "/data/.npm
>

In my docker map only:

Sorry nneed to read better:
Version: 3.19

Upgrade tot 4.08...

Same error:

-----------------------------------------------------------
2024-12-27T18:54:13.344Z Install : node-red-contrib-tasmota 1.0.0

2024-12-27T18:54:12.663Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --omit=dev --engine-strict node-red-contrib-tasmota@1.0.0
2024-12-27T18:54:15.172Z [err] npm error code EACCES
2024-12-27T18:54:15.173Z [err] npm error syscall open
2024-12-27T18:54:15.173Z [err] npm error path /data/.npm/_cacache/tmp/6b555adb
2024-12-27T18:54:15.173Z [err] npm error errno EACCES
2024-12-27T18:54:15.173Z [err] npm error
2024-12-27T18:54:15.173Z [err] npm error Your cache folder contains root-owned files, due to a bug in
2024-12-27T18:54:15.173Z [err] npm error previous versions of npm which has since been addressed.
2024-12-27T18:54:15.173Z [err] npm error
2024-12-27T18:54:15.173Z [err] npm error To permanently fix this problem, please run:
2024-12-27T18:54:15.173Z [err] npm error   sudo chown -R 1000:1000 "/data/.npm"
2024-12-27T18:54:15.179Z [err] npm error A complete log of this run can be found in: /data/.npm/_logs/2024-12-27T18_54_12_889Z-debug-0.log
2024-12-27T18:54:15.200Z rc=1

Where can i find this map? sudo chown -R 1000:1000 "/data/.npm
Perhaps manual do the thing

Can you please share your docker-compose.yml you use for your nodered instance with us?

################################################################################
# Node-RED Stack or Compose
################################################################################
# docker stack deploy node-red --compose-file docker-compose-node-red.yml
# docker-compose -f docker-compose-node-red.yml -p myNoderedProject up
#docker pull nodered/node-red
################################################################################
#version: "3.7"

services:
   node-red:
    image: nodered/node-red:latest
    restart: unless-stopped
    environment:
      - TZ=Europe/Amsterdam
    ports:
      - "1880:1880"
    networks:
      - node-red-net
    volumes:
      - node-red-data:/data
      #- ./config:/nodered/config
      #- ./data:/nodered/data
      #- ./log:/nodered/log
      #- ./data:/data

volumes:
    node-red-data:

networks:
  node-red-net:

Do you run docker on Windows? I guess so from one of your screenshots above?

Be careful with my following advise if you rely on persistent data related to your nodered instance. If so, backup your volume 'node-red-data' before going ahead.

One thing you could try at your own risk is to gain access to your running node-red container with:

docker exec -it node-red bash

OR

docker exec -it node-red sh

And run before mentioned from within your container

sudo chown -R 1000:1000 "/data/.npm"

Exit with

exit

Restart your docker instance and try to install

no on armbian on Odroid N2. My output was with putty

Thanks also,...

Only where can i find that container?

sudo chown -R 1000:1000 "/data/.npm"


Wher i do run this..

Is my file ok??

I find this on the internet [ long time ago ]
Do i need to remove the # for:
#- ./config:/nodered/config
#- ./data:/nodered/data
#- ./log:/nodered/log
#- ./data:/data

Or is this ok? [ i am windows noob sorry]

If you started your node-red container with above listed docker-compose.yml you are done.

With docker exec -it node-red bash you access your running container.

Then you can apply sudo chown ... as per the error message indicates from inside your container

exit it with exit


pi@odroidn2:~$ sudo docker exec -it node-red bash
[sudo] wachtwoord voor pi:
Error response from daemon: No such container: node-red

node-red in this command refers to your "node-red" named service in docker-compose.yml. Did you start your container with this docker-compose.yml?

what is the output of docker container list?

EDIT: I see. Your node-red container has no explicit name. My bad. I am so used to it, that I oversaw it :slight_smile:

EDIT II: Since your docker-compose.yml does not provide an explicit name for your node-red container, you will have to use the container id instead of node-red. the id is provided with docker container list, hence leading to docker exec -it CONTAINER-ID-HERE bash

Really, you should not be using Docker unless you understand how to use it. Unless you have a good reason then don't use Docker, it just makes like more complicated.

CONTAINER ID   IMAGE                           COMMAND                  CREATED                                                         STATUS                    PORTS                                                                                                                                                                                                                           NAMES
a6bd7b00f942   nodered/node-red:latest         "./entrypoint.sh"        26 minut                                               es ago   Up 26 minutes (healthy)   0.0.0.0:1880->1880/tcp, :::1880->1880/tcp                                                                                                                                                                                       nodered-node-red-1
e93d7ae1eb94   koenkk/zigbee2mqtt              "docker-entrypoint.s…"   4 days a                                               go       Up 40 minutes             0.0.0.0:8888->8888/tcp, :::8888->8888/tcp                                                                                                                                                                                       zigbee2mqtt
5bc2360c0137   domoticz/domoticz:beta          "docker-entrypoint.s…"   13 days                                                ago      Up 40 minutes             443/tcp, 0.0.0.0:8080->8080/tcp, :::8080->808                                               0/tcp                                                                                                                               domoticz
566d130bd964   zwavejs/zwave-js-ui:latest      "node server/bin/www"    4 weeks                                                ago      Up 40 minutes             0.0.0.0:3001->3001/tcp, :::3001->3001/tcp, 0.                                               0.0.0:8091->8091/tcp, :::8091->8091/tcp                                                                                             zwave-js-ui
5d2f002a0750   grafana/grafana-oss             "/run.sh"                6 months                                                ago     Up 40 minutes             0.0.0.0:3000->3000/tcp, :::3000->3000/tcp                                                                                                                                                                                       grafana
9dc2e4a1adf8   portainer/portainer-ce:latest   "/portainer"             6 months                                                ago     Up 40 minutes             0.0.0.0:9000->9000/tcp, :::9000->9000/tcp, 80                                               00/tcp, 0.0.0.0:9443->9443/tcp, :::9443->9443/tcp                                                                                   portainer
84911a7d04d5   eclipse-mosquitto               "/docker-entrypoint.…"   6 months                                                ago     Up 40 minutes             0.0.0.0:1883->1883/tcp, :::1883->1883/tcp, 0.                                               0.0.0:8883->8883/tcp, :::8883->8883/tcp, 0.0.0.0:9001->9001/tcp, :::9001->9001/t                                               cp   MQTT_Broker
9e397d03762d   influxdb:1.8.10                 "/entrypoint.sh infl…"   6 months                                                ago     Up 40 minutes             0.0.0.0:8087->8086/tcp, [::]:8087->8086/tcp                                                                                                                                                                                     influxdb

Try docker exec -it a6bd7b00f942 bash

need to learn something.. I using Domoticz for my smart home. Every year step by step smarter. Only ia m from the 70's so windows 98 millenium bug etc MNo one teached me some computer..... So i proud to run my odroid and some linux .. Also proud i can use a lot software.. ! I Am teacher in building construtions.. With al lot software, like acad, sketchup, twinmotion revit, solidworks, inventor, etc.. Like the help here in forum... So hope you can help me somewhere...

2 Likes

When i do that, it should be possible to install the nodes?
Or what is the next step?

Let's try one more thing before we proceed here:

what is the output of docker volume ls

and what is the output of docker volume inspect <volume_name> with volume_name being what is provided with docker volume ls