Cannot read property 'endsWith' of undefined
Cannot read property 'endsWith' of undefined
Subprocess exited with error 1
解決法 cdkのあらゆるコマンドに-cオプションを付ける
-cオプションで何かしらのcontextを受け取ること前提のコードを書いている場合、 cdk deploy だけでなく cdk bootstrap 等の一見パラメータが不要そうなコマンドを実行する場合にも-cオプションを付けなければこのエラーが出てしまう。
Argument of type 'this' is not assignable to parameter of type 'Construct'.
Argument of type 'this' is not assignable to parameter of type 'Construct'.
解決法 各npmパッケージのバージョンを合わせる
例えば下記のようになっていないとダメ。
"dependencies": {
"@aws-cdk/aws-certificatemanager": "^1.39.0",
"@aws-cdk/aws-cloudfront": "^1.39.0",
"@aws-cdk/aws-route53": "^1.39.0",
"@aws-cdk/aws-route53-targets": "^1.39.0",
"@aws-cdk/aws-s3": "^1.39.0",
"@aws-cdk/aws-s3-deployment": "^1.39.0",
"@aws-cdk/core": "^1.39.0"
},
"devDependencies": {
"aws-cdk": "^1.39.0"
}
パッと見、合っているようでも合っていないことがあるので注意。
バージョンに ^ が入っているパッケージと入っていないパッケージが混在していたりするとダメ。
全部合っているはずなのに上記エラーが出るなら、一度 npm_modules フォルダを削除してから再度 npm install する。
Cloud assembly schema version mismatch: Maximum schema version supported is 2.0.0, but found 3.0.0.
Cloud assembly schema version mismatch: Maximum schema version supported is 2.0.0, but found 3.0.0.
Please upgrade your CLI in order to interact with this app.
解決法 グローバルインストールされているaws-cdkパッケージのバージョンを合わせる
これも前述と似ているが、グローバルのcdkコマンドを実行している場合に発生するエラー。
その場合は、各パッケージとグローバルのaws-cdkのバージョンが違うとダメ。(なので aws-cdk パッケージに関してはグローバルインストールはあまりオススメしない)