Skip to content

Debian 10 won't run this module #252

@cjohnweb

Description

@cjohnweb

Here's some context:

debian@bgw00000000:~/prototypeF$ nvm --version
0.38.0
debian@bgw00000000:~/prototypeF$ node --version
v14.17.3
debian@bgw00000000:~/prototypeF$ npm --version
7.20.0
debian@bgw00000000:~/prototypeF$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
debian@bgw00000000:~/prototypeF$ cat /proc/cpuinfo 
processor       : 0
model name      : ARMv7 Processor rev 2 (v7l)
BogoMIPS        : 995.32
Features        : half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x3
CPU part        : 0xc08
CPU revision    : 2

Hardware        : Generic AM33XX (Flattened Device Tree)
Revision        : 0000
Serial          : BBGW16055134
debian@bgw00000000:~/prototypeF$ 

On a new, small express sample project I npm install mdns --save

debian@bgw00000000:~/prototypeF$ npm list mdns
prototypef@1.0.0 /home/debian/prototypeF
└── mdns@2.7.2

Then I write a simple piece of server side code in a class to broadcast that I have a web server on port 80, which looks something like this:

createmDNSAdvertisement() {
    let port = process.env.NODE_PORT || 80
    const httpAd = mdns.createAdvertisement(mdns.tcp('http'), parseInt(port))
    httpAd.start()
  }

But when I npm start, I get the following:

debian@bgw00000000:~/prototypeF$ npm start

> prototypef@1.0.0 start
> export $(cat .env | xargs) && nodemon main.js

[nodemon] 1.19.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node main.js`
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
         -- mDNS: mDNS Advertising as MintonTech
/home/debian/prototypeF/node_modules/mdns/lib/advertisement.js:56
  dns_sd.DNSServiceRegister(self.serviceRef, flags, ifaceIdx, name,
         ^

Error: dns service error: unknown
    at new Advertisement (/home/debian/prototypeF/node_modules/mdns/lib/advertisement.js:56:10)
    at Object.create [as createAdvertisement] (/home/debian/prototypeF/node_modules/mdns/lib/advertisement.js:64:10)
    at MulticastDNSService.createmDNSAdvertisement (/home/debian/prototypeF/service-mdns.js:31:25)
    at new MulticastDNSService (/home/debian/prototypeF/service-mdns.js:24:10)
    at Object.<anonymous> (/home/debian/prototypeF/main.js:67:12)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  errorCode: -65537
}
[nodemon] app crashed - waiting for file changes before starting...

So line 31 of my service-mdns.js looks like this:

const httpAd = mdns.createAdvertisement(mdns.tcp('http'), parseInt(port))

I've read some projects which claim that lines starting with *** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi. is normal and to just ignore it. But as you can see, I can't simply ignore it. I've installed previous versions, like 5.2.1. I've tried installing/updating everything from my build tools to the avahi library installed on my system.

I'm assuming it's an issue with the npm package, but I'm not certain. Is anyone else having similar issues? If so, what fixed it for you? Or is this package being phased out as some claim?

Thanks

PS. My package.json file:

{
    "name": "prototypef",
    "version": "1.0.0",
    "description": "PrototypeF for use with PrototypeA",
    "main": "main.js",
    "dependencies": {
      "bluebird": "^3.5.1",
      "body-parser": "^1.18.2",
      "bonescript": "^0.7.4-beta1",
      "cors": "^2.8.5",
      "dotenv": "^4.0.0",
      "express": "^4.16.2",
      "mdns": "^2.7.2",
      "moment": "^2.24.0",
      "node-fetch": "^2.6.1",
      "pm2": "^4.2.1",
      "ramda": "^0.17.1",
      "request-promise": "^2.0.1",
      "socket.io": "^2.3.0",
      "socket.io-client": "^2.3.0",
      "sqlite3": "^5.0.2",
      "uuid": "^8.3.1"
    },
    "optionalDependencies": {
      "fsevents": "^2.3.2"
    },
    "devDependencies": {
      "nodemon": "^1.7.3"
    },
    "keywords": [
      "prototype"
    ],
    "author": "John",
    "license": "MIT",
    "bugs": {
      "url": ""
    },
    "homepage": "",
    "scripts": {
      "start": "export $(cat .env | xargs) && nodemon main.js",
      "tracewarnings": "export $(cat .env | xargs) && node --trace-warnings main.js",
      "startpm2": "pm2 start main.js",
      "restartpm2": "pm2 restart all"
    }
  }
  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions