我有一个受版本控制的角度项目。在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
,但它保持不变
我也将cli的版本从7升级到了8,没有运气
答案 0 :(得分:2)
看起来您需要在Ubuntu计算机上将打字稿版本升级到3.7。来自typescript 3.7 release notes:
要检测访问器周围的问题,TypeScript 3.7现在将发出 获取/设置.d.ts文件中的访问器,以便在TypeScript中检查 覆盖的访问者。所以大概是用 打字稿3.7,并发出以前版本没有的定义文件 了解。因此,您需要升级到打字稿3.7或使用 sequelize的早期版本。