@Types/Sequelize Error TS1086: An accessor cannot be declared in ambient context

后端 未结 3 530
南旧
南旧 2020-12-06 16:41

I have a project that shows this error when I run \'tsc\':

../modules/node_modules/sequelize/types/lib/transaction.d.ts:33:14 - error TS1086: An accessor can         


        
3条回答
  •  抹茶落季
    2020-12-06 16:55

    you need to use typescript 3.7.

    from typescript 3.7 release notes:

    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.
    
    

    so presumably sequelize was compiled with typescript 3.7 and emits definition files that previous versions don't understand. So you'll need to upgrade to typescript 3.7 or use an earlier version of sequelize.

提交回复
热议问题