Twilio 聊天模块错误 TS1086 无法在环境上下文中声明访问器
Twillio Chat Module error TS1086 An accessor cannot be declared in an ambient context
我有一个受版本控制的 angular 项目。它在 windows 机器上运行良好。
但是当我将更改拉到我的 Ubuntu 19 机器时,我总是得到一个 twillio 聊天模块错误:
ERROR in node_modules/twilio-chat/lib/channel.d.ts(122,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(123,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(124,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(125,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(126,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(127,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(128,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(129,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(130,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(131,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(132,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(133,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/client.d.ts(130,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/client.d.ts(131,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/client.d.ts(132,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/configuration.d.ts(13,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/configuration.d.ts(14,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/configuration.d.ts(15,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/configuration.d.ts(16,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/configuration.d.ts(17,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/configuration.d.ts(18,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/media.d.ts(23,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/media.d.ts(24,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/media.d.ts(25,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/media.d.ts(26,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(53,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(54,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(55,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(56,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(57,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(58,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(59,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(60,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(61,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(62,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(48,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(49,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(50,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(51,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(52,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(53,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(54,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(55,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(56,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(57,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(58,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/restpaginator.d.ts(12,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/restpaginator.d.ts(13,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/restpaginator.d.ts(14,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/services/typingindicator.d.ts(21,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/session.d.ts(30,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/session.d.ts(31,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/user.d.ts(50,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/user.d.ts(51,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/user.d.ts(52,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/user.d.ts(53,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/user.d.ts(54,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/user.d.ts(55,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/user.d.ts(56,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/user.d.ts(57,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/util/deferred.d.ts(7,9): error TS1086: An accessor cannot be declared in an ambient context.
我尝试删除 node_module 文件夹并使用 npm install
但它保持不变
我也将 angular cli 的版本从 7 升级到 8,但没有成功
看来您需要将 Ubuntu 机器上的打字稿版本升级到 3.7。来自 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.
我有一个受版本控制的 angular 项目。它在 windows 机器上运行良好。 但是当我将更改拉到我的 Ubuntu 19 机器时,我总是得到一个 twillio 聊天模块错误:
ERROR in node_modules/twilio-chat/lib/channel.d.ts(122,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(123,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(124,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(125,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(126,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(127,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(128,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(129,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(130,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(131,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(132,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/channel.d.ts(133,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/client.d.ts(130,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/client.d.ts(131,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/client.d.ts(132,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/configuration.d.ts(13,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/configuration.d.ts(14,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/configuration.d.ts(15,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/configuration.d.ts(16,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/configuration.d.ts(17,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/configuration.d.ts(18,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/media.d.ts(23,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/media.d.ts(24,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/media.d.ts(25,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/media.d.ts(26,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(53,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(54,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(55,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(56,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(57,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(58,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(59,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(60,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(61,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/member.d.ts(62,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(48,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(49,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(50,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(51,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(52,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(53,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(54,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(55,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(56,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(57,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/message.d.ts(58,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/restpaginator.d.ts(12,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/restpaginator.d.ts(13,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/restpaginator.d.ts(14,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/services/typingindicator.d.ts(21,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/session.d.ts(30,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/session.d.ts(31,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/user.d.ts(50,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/user.d.ts(51,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/user.d.ts(52,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/user.d.ts(53,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/user.d.ts(54,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/user.d.ts(55,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/user.d.ts(56,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/user.d.ts(57,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/twilio-chat/lib/util/deferred.d.ts(7,9): error TS1086: An accessor cannot be declared in an ambient context.
我尝试删除 node_module 文件夹并使用 npm install
但它保持不变
我也将 angular cli 的版本从 7 升级到 8,但没有成功
看来您需要将 Ubuntu 机器上的打字稿版本升级到 3.7。来自 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.