我有這個樣本的Node.js腳本:樹莓PI MDNS的getaddrinfo 3008錯誤
var mdns = require('mdns');
var browser = mdns.createBrowser(mdns.tcp('http'));
browser.on('error', function (error) {
console.log("error");
console.log(error);
});
browser.on('serviceUp', function (service) {
console.log("serviceUp");
console.log(service);
});
browser.start();
我的Mac上它的正常工作,而且兩個服務被發現。如果我在我的樹莓PI 2運行Raspbean(連接到同一網絡)上運行完全一樣的劇本,我得到這樣的輸出:
[email protected] ~ $ node mdns.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/avahi-compat?s=libdns_sd&e=node>
*** 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/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>
error
{ [Error: getaddrinfo -3008] code: -3008, errno: -3008, syscall: 'getaddrinfo' }
error
{ [Error: getaddrinfo -3008] code: -3008, errno: -3008, syscall: 'getaddrinfo' }
一個issue on the mdns GitHub,說這是公平地忽略警告。
但是,這兩個錯誤呢?這是我的Raspberry PI上的某種配置問題嗎?
node.js的哪個版本在覆盆子pi上運行? – flotto