typescript - 当我在 vue.js 中 npm runbuild 得到错误接口(interface) 'NodeRequire' 不能同时扩展类型 'Require'

标签 typescript vue.js webpack

ERROR in C:/phpStudy2018/PHPTutorial/WWW/Tms.Web/node_modules/@types/node/globals.d.ts(139,11):
139:11 Interface 'NodeRequire' cannot simultaneously extend types 'Require' and 'RequireFunction'.
  Named property 'cache' of types 'Require' and 'RequireFunction' are not identical.
    137 |
    138 | // For backwards compability
  > 139 | interface NodeRequire extends NodeJS.Require {}
        |           ^
    140 | interface RequireResolve extends NodeJS.RequireResolve {}
    141 | interface NodeModule extends NodeJS.Module {}
    142 |

 error  in C:/phpStudy2018/PHPTutorial/WWW/Tms.Web/node_modules/@types/node/globals.d.ts

ERROR in C:/phpStudy2018/PHPTutorial/WWW/Tms.Web/node_modules/@types/node/globals.d.ts(139,11):


我的环境是 vue.js + typescript。不知道是我的配置有问题还是第三方包有问题
你能给我一些有用的建议吗
谢谢

最佳答案

我有同样的问题。

@types/node 的版本是 13.1.0
格林威治标准时间 2019 年 12 月 23 日星期一 16:40:55 发布

就我而言,当我使用以前的版本 12.12.22 时它正在工作
npm install --save-dev @types/node@12.12.22

关于typescript - 当我在 vue.js 中 npm runbuild 得到错误接口(interface) 'NodeRequire' 不能同时扩展类型 'Require',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59474983/

相关文章:

javascript - Webpack 模块联合不适用于急切的共享库

Angular2/PrimeNG - 无法显示下拉列表

angular - 如何将 Angular 5 变量绑定(bind)到 LESS 变量?

javascript - 无法使用 Pinia Store 从状态检索数据

使用 Vue js 编写 typescript

javascript - vuejs刷新后无法加载二级路由页面

angular - Webpack 和 TypeScript - 包括 Moment.js 插件

Angular2 与 SystemJs 和 typescript 转译器不工作

javascript - Typescript/Electron/Webpack 模块如何/为什么有绝对路径?

webpack - 如何在配置文件中将模式设置为开发或生产?