Skip to content
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

os.networkInterfaces() return family as number instead of string at 18.x #42904

Closed
atian25 opened this issue Apr 29, 2022 · 1 comment
Closed

Comments

@atian25
Copy link
Contributor

atian25 commented Apr 29, 2022

Version

18.0.0

Platform

Darwin TZ 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000 arm64

Subsystem

No response

What steps will reproduce the bug?

$ node -p 'os.networkInterfaces()'

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

$ node -v
v16.14.2

$ node -p 'os.networkInterfaces()'

{
  lo0: [
    {
      address: '127.0.0.1',
      netmask: '255.0.0.0',
      family: 'IPv4',
      mac: '00:00:00:00:00:00',
      internal: true,
      cidr: '127.0.0.1/8'
    },  
]

What do you see instead?

$ node -v
v18.0.0

$ node -p 'os.networkInterfaces()'

{
  lo0: [
    {
      address: '127.0.0.1',
      netmask: '255.0.0.0',
      family: 4,
      mac: '00:00:00:00:00:00',
      internal: true,
      cidr: '127.0.0.1/8'
    },  
]

Additional information

as docs says:

family [] Either IPv4 or IPv6

@atian25 atian25 changed the title os.networkInterfaces() return family as number os.networkInterfaces() return family as number instead of string at 18.x Apr 29, 2022
@y1d7ng
Copy link
Contributor

y1d7ng commented Apr 29, 2022

refer #42861

@atian25 atian25 closed this as completed Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants