AWSAWS CDKJavaScriptNode.js

How to fix the Error Argument of type ‘this’ is not assignable to parameter of type ‘Construct’. when you build the AWS CDK stack

What I saw Create a new Stack by AWS CDK Nothing to do several days. Add new resources into the project Failed […]

広告ここから
広告ここまで

What I saw

  • Create a new Stack by AWS CDK
  • Nothing to do several days.
  • Add new resources into the project
  • Failed the npm run buildcommand with theArgument of type 'this' is not assignable to parameter of type 'Construct'error.

Why I get the Error

The error comes from version diff. My package.json is following. The SNS / SQS and core packages are v0.13.0, but EC2 is v0.14.1.

    "devDependencies": {
        "@types/node": "^8.9.4",
        "typescript": "^3.1.2",
        "aws-cdk": "^0.13.0"
    },
    "dependencies": {
        "@aws-cdk/aws-ec2": "^0.14.1",
        "@aws-cdk/aws-sns": "^0.13.0",
        "@aws-cdk/aws-sqs": "^0.13.0",
        "@aws-cdk/cdk": "^0.13.0"
    }

I resolved the issue by rm -rf node_modules/ && npm i command.

    "devDependencies": {
        "@types/node": "^8.9.4",
        "typescript": "^3.1.2",
        "aws-cdk": "^0.14.1"
    },
    "dependencies": {
        "@aws-cdk/aws-ec2": "^0.14.1",
        "@aws-cdk/aws-sns": "^0.14.1",
        "@aws-cdk/aws-sqs": "^0.14.1",
        "@aws-cdk/cdk": "^0.14.1"
    }

ブックマークや限定記事(予定)など

WP Kyotoサポーター募集中

WordPressやフロントエンドアプリのホスティング、Algolia・AWSなどのサービス利用料を支援する「WP Kyotoサポーター」を募集しています。
月額または年額の有料プランを契約すると、ブックマーク機能などのサポーター限定機能がご利用いただけます。

14日間のトライアルも用意しておりますので、「このサイトよく見るな」という方はぜひご検討ください。

広告ここから
広告ここまで

Related Category posts