awsrun / aws-microservices

AWS Serverless Event-driven Microservices with using AWS Lambda, AWS DynamoDB, AWS API Gateway, AWS EventBridge, AWS SQS, AWS CDK stands for Cloud Development Kit for IaC — Infrastructure as Code tool and AWS CloudWatch for monitoring.
https://www.udemy.com/course/aws-serverless-microservices-lambda-eventbridge-sqs-apigateway/?couponCode=OCTO24
MIT License
306 stars 158 forks source link

esbuild cannot run locally #1

Open andyRokit opened 2 years ago

andyRokit commented 2 years ago

When I run cdk deploy (or cdk synth) I receive the following error:

Bundling asset AwsMicroservicesStack/Microservices/productLambdaFunction/Code/Stage...
esbuild cannot run locally. Switching to Docker bundling.
✘ [ERROR] Could not resolve "@aws-sdk/client-dynamodb"

See full console output

This may be related to https://github.com/aws/aws-cdk/pull/14914/files (which apparently fixed the issue for CDK v1).

nenigaikgedon commented 1 year ago

In my case this was resolved by installation of the missing packages, e.g.: npm install @aws-sdk/client-dynamodb

Another issue was usage of NodeJS v19 that's currently unsupported by the CDK, but its downgrade to LTS v18 resolved that.