electron 7 typescript @types/node v13 问题


如果运行v13 版本的node types 会发现有如下错误

错误信息

node_modules/electron/electron.d.ts:7145:33 - error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?

原因

当前electron 7 不支持@types/node 13 版本的

解决方法

使用12 版本的比较好

  • 命令
yarn add @types/node@12.12.6 --dev

参考

https://github.com/electron/electron/issues/21612
https://electronjs.org/blog/electron-7-0


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM