-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash on RaspberryPi #31
Comments
I see. Does this work on older versions of Node? (v4.x.x, v6.x.x) Can you link to the relevant version in the Node changelog to see how/when/why this behaviour changed? |
Your response is just here :) 👍 https://stackoverflow.com/questions/31096596/why-is-foreach-not-a-function-for-this-object/31096661 |
Yikes. I AM aware that POJO's don't respond to |
I don't know, maybe it's just on some platform/OS |
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;
}
});
The text was updated successfully, but these errors were encountered: