gpt4 book ai didi

node.js - 抛出新的 TypeError ('The super constructor to "inherits"must not ' +

转载 作者:搜寻专家 更新时间:2023-10-31 23:40:21 24 4
gpt4 key购买 nike

我正在尝试构建我的 nodejs 应用程序。但我总是收到这个错误。

util.js:988
throw new TypeError('The super constructor to "inherits" must not ' +
^

TypeError: The super constructor to "inherits" must not be null or undefined
at Object.inherits (util.js:988:11)
at Object.<anonymous> (D:\CIDE-Backend\CIDE-BACKEND\node_modules\zetta\node_modules\spdy\lib\spdy\connection.js:86:6)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (D:\CIDE-Backend\CIDE-BACKEND\node_modules\zetta\node_modules\spdy\lib\spdy.js:20:19)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
[nodemon] app crashed - waiting for file changes before starting...

我关注了这个solution但我仍然遇到同样的错误。

我的node版本是8.4.0

我的 npm 版本是 5.5.1

你能告诉我如何解决这个错误吗?

最佳答案

您的依赖项 zetta 包含一个旧版本的 spdy,它与您当前版本的 Node 不兼容。当前在 zetta's github 上有一个 Unresolved 问题关于这个,有一个解决方法:

process.EventEmitter = require('events').EventEmitter
const zetta = require('zetta')

您的里程数可能因该 hack 而异,我自己还没有测试过。或者,您可以等待 zetta 团队修复他们的依赖项或降级您的 Node 安装。

关于node.js - 抛出新的 TypeError ('The super constructor to "inherits"must not ' +,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47179831/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com