我有一个项目在运行'tsc'时显示此错误:
../modules/node_modules/sequelize/types/lib/transaction.d.ts:33:14 - error TS1086: An accessor cannot be declared in an ambient context.
33 static get LOCK(): LOCK;
~~~~
../modules/node_modules/sequelize/types/lib/transaction.d.ts:40:7 - error TS1086: An accessor cannot be declared in an ambient context.
40 get LOCK(): LOCK;
~~~~
我的版本是:
该项目可与nodemon正常运行,但在尝试编译打字稿时失败。有人知道这个错误吗?
谢谢。
您需要使用打字稿3.7。
To detect the issue around accessors, TypeScript 3.7 will now emit get/set accessors in .d.ts files so that in TypeScript can check for overridden accessors.
因此大概sequelize
是使用TypeScript 3.7编译的,并发出了以前版本无法理解的定义文件。因此,您需要升级到打字稿3.7或使用早期版本的sequelize。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句