Skip to content

Crash on RaspberryPi #31

@nervousapps

Description

@nervousapps

On raspberry with node version 10.6.0, I have the error :
/home/pi/rdr/node_modules/network/lib/linux.js:87
nics[key].forEach(function(type) {
^

TypeError: nics[key].forEach is not a function
at Object.exports.get_network_interfaces_list (/home/pi/rdr/node_modules/network/lib/linux.js:87:17)
at nic_by_name (/home/pi/rdr/node_modules/network/lib/index.js:21:16)
at /home/pi/rdr/node_modules/network/lib/index.js:98:5
at /home/pi/rdr/node_modules/network/lib/linux.js:26:5
at ChildProcess.exithandler (child_process.js:282:7)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:961:16)
at Socket.stream.socket.on (internal/child_process.js:380:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close (net.js:598:12)

To make it work, just change line 87:

nics[key].forEach(function(type) {
if (type.family == 'IPv4') {
obj.ip_address = type.address;
}
});

TO :

Object.keys(nics[key]).forEach(function(type) {
if (type.family == 'IPv4') {
obj.ip_address = type.address;
}
});

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