# Error when installing/removing nodes

**URL:** <https://discourse.nodered.org/t/error-when-installing-removing-nodes/35586>\
**Category:** General\
**Created:** [9 November 2020 09:38 UTC](https://discourse.nodered.org/t/error-when-installing-removing-nodes/35586 "2020-11-09T09:38:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [9 November 2020 09:38 UTC](https://discourse.nodered.org/t/error-when-installing-removing-nodes/35586/1 "2020-11-09T09:38:12Z")

</div>

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

```auto
> 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/obj.target/dns_sd_bindings/src/dns_sd.o
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: *** [dns_sd_bindings.target.mk:177: Release/obj.target/dns_sd_bindings/src/dns_sd.o] 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`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

```

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [9 November 2020 09:55 UTC](https://discourse.nodered.org/t/error-when-installing-removing-nodes/35586/2 "2020-11-09T09:55:37Z")

</div>

That is most likely from the [https://flows.nodered.org/node/node-red-node-discovery](https://flows.nodered.org/node/node-red-node-discovery) . So depends on the operating system which pre-reqs you need...

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [9 November 2020 10:11 UTC](https://discourse.nodered.org/t/error-when-installing-removing-nodes/35586/3 "2020-11-09T10:11:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [9 November 2020 12:21 UTC](https://discourse.nodered.org/t/error-when-installing-removing-nodes/35586/4 "2020-11-09T12:21:03Z")

</div>

If you don’t use it you could also just uninstall it 🙂

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [9 November 2020 12:57 UTC](https://discourse.nodered.org/t/error-when-installing-removing-nodes/35586/5 "2020-11-09T12:57:38Z")

</div>

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](https://flows.nodered.org/node/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)??

---

<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:** [9 November 2020 14:45 UTC](https://discourse.nodered.org/t/error-when-installing-removing-nodes/35586/6 "2020-11-09T14:45:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [9 November 2020 15:31 UTC](https://discourse.nodered.org/t/error-when-installing-removing-nodes/35586/7 "2020-11-09T15:31:52Z")

</div>

> [@Colin](#):
>
> You can find which node(s)....

Thanks Colin, that's useful to know.

```auto
    "node-red-contrib-googlehome": {
      "version": "0.0.10",
      "resolved": "https://registry.npmjs.org/node-red-contrib-googlehome/-/node-red-contrib-googlehome-0.0.10.tgz",
      "integrity": "sha512-9xYexnO5fGvlqbCEGj4lb2RTzWxTJy7QbxwYV2gffTf6e5kQOXIiPEi2gzO7AjU9FCS9y+wOHMJvgJO+s3Kig==",
      "requires": {
        "mdns": "^2.5.1",
        "mqtt": "^2.15.0",
        "request": "^2.83.0"
      }
    }

```

---

<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:** [23 November 2020 15:31 UTC](https://discourse.nodered.org/t/error-when-installing-removing-nodes/35586/8 "2020-11-23T15:31:53Z")

</div>

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