1

I am trying to run a Testcafe test but get the following Error. This used to work until I recently updated npm and Node.

 npm test

> e2e-tests@1.0.0 test
> node index.js test

TypeError: details.family.toLowerCase is not a function
    at C:\mac\github\e2e-tests\node_modules\ip\lib\ip.js:385:39
    at Array.filter (<anonymous>)
    at C:\mac\github\e2e-tests\node_modules\ip\lib\ip.js:384:37
    at Array.map (<anonymous>)
    at ip.address (C:\mac\e2e-tests\node_modules\ip\lib\ip.js:379:37)
    at Proxy.getIPAddress (C:\mac\e2e-tests\node_modules\endpoint-utils\index.js:109:15)
    at getValidHostname (C:\mac\e2e-tests\node_modules\testcafe\lib\index.js:26:34)
    at createTestCafe (C:\mac\e2e-tests\node_modules\testcafe\lib\index.js:71:9)
    at async run (C:\mac\e2e-tests\test-runner.js:40:20)
    at async testRunner (C:\mac\e2e-tests\test-runner.js:117:10)
    at async start (C:\mac\e2e-tests\index.js:9:22)
Shane
  • 11
  • 3

1 Answers1

3

This appears to be a bug with version 18 of node, interacting with the ip package (used in lots of popular libraries like Storybook and next ui).

You can try over-riding to use the latest version of ip:

{
  "overrides": {
    "ip": "1.1.8"
  }
}

But - in my case at least - I ran into further issues with that approach. The only "fix" for now is to downgrade to use the long-term support (LTS) version of node/npm (currently 16.15.1) rather than 17/18. I highly recommend nvm, which will let you just do nvm install lts.

CherryFlavourPez
  • 7,529
  • 5
  • 45
  • 47