Error when installing/removing nodes

Whenever I add or remove any contrib nodes, I always get the error below.
The directory /home/pi/.node-red/node_modules/mdns does not exist, and mdns is not listed in my package.json
The second 'warning' is something relating to Bart's xterm node, which I alerted him to, a while back.

Node-RED version: v1.2.2
Node.js version: v12.19.0
NPM version: 6.14.8

> mdns@2.5.1 install /home/pi/.node-red/node_modules/mdns
> node-gyp rebuild

make: Entering directory '/home/pi/.node-red/node_modules/mdns/build'
  CXX(target) Release/
In file included from ../src/dns_sd.cpp:1:
../src/mdns.hpp:32:10: fatal error: dns_sd.h: No such file or directory
 #include <dns_sd.h>
compilation terminated.
make: *** [ Release/] Error 1
make: Leaving directory '/home/pi/.node-red/node_modules/mdns/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit(/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.4.72-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/.node-red/node_modules/mdns
gyp ERR! node -v v12.19.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN xterm-addon-fit@0.3.0 requires a peer of xterm@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: mdns@2.5.1 (node_modules/mdns):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: mdns@2.5.1 install: `node-gyp rebuild`

That is most likely from the . So depends on the operating system which pre-reqs you need...

1 Like

Well I don't use node-red-node-discovery, but from that node's readme, it gives pre-requisite libraries - sudo apt-get install libavahi-compat-libdnssd-dev libudev-dev that are required.
I've installed them, rebooted, and both the errors & warnings are now gone!

Good call @dceejay

If you don’t use it you could also just uninstall it :slight_smile:

I should have made clear, I don't have node-red-node-discovery installed, never have.

Although I do have Ben's node-red-contrib-googlehome installed which requires libavahi-compat-libdnssd-dev - which I had already installed some months ago when I installed googlehome (it's described in the node's readme).

So either that package installation failed or is libudev-dev needed as well as libavahi-compat-libdnssd-dev (as described in the node-red-node-discovery readme)??

1 Like

You can find which node(s) is pulling in mdns by searching for it in package-lock.json

1 Like

Thanks Colin, that's useful to know.

    "node-red-contrib-googlehome": {
      "version": "0.0.10",
      "resolved": "",
      "integrity": "sha512-9xYexnO5fGvlqbCEGj4lb2RTzWxTJy7QbxwYV2gffTf6e5kQOXIiPEi2gzO7AjU9FCS9y+wOHMJvgJO+s3Kig==",
      "requires": {
        "mdns": "^2.5.1",
        "mqtt": "^2.15.0",
        "request": "^2.83.0"

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