Skip to content

ip node module in node 18, TypeError: details.family.toLowerCase is not a function #2

@hufeng

Description

@hufeng

source code

const ip = require('ip')

console.log(ip.address())

node version

$ node -v
v18.0.0

result

/private/tmp/t/node_modules/.pnpm/registry.npmmirror.com+ip@1.1.5/node_modules/ip/lib/ip.js:386
details.family = details.family.toLowerCase();
^

TypeError: details.family.toLowerCase is not a function
at /private/tmp/t/node_modules/.pnpm/registry.npmmirror.com+ip@1.1.5/node_modules/ip/lib/ip.js:386:39
at Array.filter ()
at /private/tmp/t/node_modules/.pnpm/registry.npmmirror.com+ip@1.1.5/node_modules/ip/lib/ip.js:384:37
at Array.map ()
at ip.address (/private/tmp/t/node_modules/.pnpm/registry.npmmirror.com+ip@1.1.5/node_modules/ip/lib/ip.js:379:37)
at Object. (/private/tmp/t/test.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Module._load (node:internal/modules/cjs/loader:827:12)

current status

Upstream already has a pr
indutny/node-ip#114

TODO

  • Follow up with upstream pr, pending issue resolution, ci support node18

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