我如何修复:details.family.tolowercase不是一个函数
我正在尝试运行测试库测试,但会出现以下错误。直到我最近更新NPM和节点为止。
npm test
> [email protected] 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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这似乎是 bug 与节点的版本18,与 ip软件包(用于许多流行的库中Storybookjs/storybook/desission/18010“ rel =“ nofollow noreferrer”> Storybook 和下一个UI )。
您可以尝试过度骑行
IP
的版本至少在我的情况下 - 我遇到采用这种方法。目前唯一的“修复程序”是降级使用Node/npm的长期支持(LTS)版本(当前 16.15.1 )而不是17/18。我强烈推荐 nvm ,它会让您只需
nvm instal lts lts lts
。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
: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
.