But perhaps the main reason is that assert module isn't installed in my .node-red folder. I assume I must have than a folder /home/pi/.node-red/node_modules/assert ?
How can II install assert as a module? And does I need to extend the settings.js part: functionGlobalContext?
assert is a built-in module of node.js - you don't need to install it separately. But you do still need to add it to the external modules list in the Function node - the runtime will recognise its a built-in module and not try to install it from npm.
Thanks, I changed my settings.js and did a node-red restart, getting the following output:
Welcome to Node-RED
===================
19 Apr 18:38:21 - [info] Node-RED version: v3.0.2
19 Apr 18:38:21 - [info] Node.js version: v16.19.1
19 Apr 18:38:21 - [info] Linux 5.10.103-v7+ arm LE
19 Apr 18:38:23 - [info] Loading palette nodes
19 Apr 18:38:42 - [info] Dashboard version 3.4.0 started at /ui
19 Apr 18:38:45 - [info] Settings file : /home/pi/.node-red/settings.js
19 Apr 18:38:45 - [info] Context store : 'default' [module=memory]
19 Apr 18:38:45 - [info] User directory : /home/pi/.node-red
19 Apr 18:38:45 - [warn] Projects disabled : editorTheme.projects.enabled=false
19 Apr 18:38:45 - [warn] Flows file name not set. Generating name using hostname.
19 Apr 18:38:45 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
19 Apr 18:38:45 - [error] Uncaught Exception:
19 Apr 18:38:45 - [error] Error: listen EADDRINUSE: address already in use 0.0.0.0:1880
at Server.setupListenHandle [as _listen2] (node:net:1463:16)
at listenInCluster (node:net:1511:12)
at doListen (node:net:1660:7)
at processTicksAndRejections (node:internal/process/task_queues:84:21)
Than I restarted the editor. But I always get the old setup without the possibility to nomw modules
I'm confused regarding the error, because the connection/editor work.
The currently running Node RED needed restarting, not a new instance being started
Your old instance never got restarted by the sounds of it - as you can't see the changes you made to settings.