2022年7月3日日曜日

CDKのエラーをメモっていく

 エラー

--app is required either in command-line, in cdk.json or in ~/.cdk.json というエラ

https://docs.aws.amazon.com/cdk/v2/guide/troubleshooting.html#troubleshooting_app_required

This message usually means that you aren't in the main directory of your AWS CDK project when you issue cdk synth. 

ディレクトリが間違っている

cdk workshoptの日本語版はv1だった件

cdk workshopで日本語版でやっていたらv1 の内容だったため、インストールしてたのがv2なのでうまくいかず、このエラー。解決策→英語版はv2で書かれていましたのでそちらを。


/home/user/Desktop/aws/cdk/cdk-workshop/node_modules/ts-node/src/index.ts:843

    return new TSError(diagnosticText, diagnosticCodes, diagnostics);

           ^

TSError: ⨯ Unable to compile TypeScript:

bin/cdk-workshop.ts:6:23 - error TS2345: Argument of type 'import("/home/user/Desktop/aws/cdk/cdk-workshop/node_modules/aws-cdk-lib/core/lib/app").App' is not assignable to parameter of type 'import("/home/user/Desktop/aws/cdk/cdk-workshop/node_modules/@aws-cdk/core/lib/app").App'.

  Type 'App' is missing the following properties from type 'App': onValidate, onPrepare, onSynthesize, validate, and 2 more.


6 new CdkworkshopStack(app, 'CdkworkshopStack');

                        ~~~


    at createTSError (/home/user/Desktop/aws/cdk/cdk-workshop/node_modules/ts-node/src/index.ts:843:12)

    at reportTSError (/home/user/Desktop/aws/cdk/cdk-workshop/node_modules/ts-node/src/index.ts:847:19)

    at getOutput (/home/user/Desktop/aws/cdk/cdk-workshop/node_modules/ts-node/src/index.ts:1057:36)

    at Object.compile (/home/user/Desktop/aws/cdk/cdk-workshop/node_modules/ts-node/src/index.ts:1411:41)

    at Module.m._compile (/home/user/Desktop/aws/cdk/cdk-workshop/node_modules/ts-node/src/index.ts:1596:30)

    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)

    at Object.require.extensions.<computed> [as .ts] (/home/user/Desktop/aws/cdk/cdk-workshop/node_modules/ts-node/src/index.ts:1600:12)

    at Module.load (node:internal/modules/cjs/loader:988:32)

    at Function.Module._load (node:internal/modules/cjs/loader:834:12)

    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {

  diagnosticCodes: [ 2345 ]

}


Subprocess exited with error 1

0 件のコメント:

コメントを投稿