1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[備忘録] error TS1005, TS1011, TS1128 の解消

Posted at

はじめに

AWS CDK TypeScriptプロジェクトを作成し、npm run build を実行したところ、下記のエラーが発生した。

node_modules/@types/babel__traverse/index.d.ts:68:50 - error TS1005: ']' expected.

68 export type ArrayKeys<T> = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
                                                    ~~

node_modules/@types/babel__traverse/index.d.ts:68:53 - error TS1005: ';' expected.

68 export type ArrayKeys<T> = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
                                                       ~

node_modules/@types/babel__traverse/index.d.ts:68:58 - error TS1005: ';' expected.

68 export type ArrayKeys<T> = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
                                                            ~~~~~~~

node_modules/@types/babel__traverse/index.d.ts:68:70 - error TS1011: An element access expression should take an argument.

68 export type ArrayKeys<T> = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
                                                                        

node_modules/@types/babel__traverse/index.d.ts:68:83 - error TS1005: ';' expected.

68 export type ArrayKeys<T> = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
                                                                                     ~

node_modules/@types/babel__traverse/index.d.ts:68:84 - error TS1128: Declaration or statement expected.

68 export type ArrayKeys<T> = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
                                                                                      ~

node_modules/@types/babel__traverse/index.d.ts:68:88 - error TS1128: Declaration or statement expected.

68 export type ArrayKeys<T> = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
                                                                                          ~


Found 7 errors.

実施したこと

typescriptのバージョンを上げたら、ビルドできることが確認できた。

package.json
"typescript": "~3.9.7"

package.json
"typescript": "^4.9.3"

最後に

参考にした文献を記す。
https://github.com/DefinitelyTyped/DefinitelyTyped/issues/63431

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?