私は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マシンでTypeScriptバージョンを3.7にアップグレードする必要があるようです。 TypeScript 3.7リリースノート から:
TypeScript 3.7は、アクセサーに関する問題を検出するために、.d.tsファイルでget/setアクセサーを発行し、TypeScriptでオーバーライドされたアクセサーをチェックできるようになりました。したがって、おそらくsequelizeはTypeScript 3.7でコンパイルされ、以前のバージョンでは理解できない定義ファイルを出力します。したがって、TypeScript 3.7にアップグレードするか、以前のバージョンのsequelizeを使用する必要があります。