@@ -9,7 +9,7 @@ This project provides a thin wrapper script `cdklocal` for using the [AWS CDK](h
99## Quick Installation
1010
1111The ` cdklocal ` command line is published as an [ npm library] ( https://www.npmjs.com/package/aws-cdk-local ) :
12- ```
12+ ``` bash
1313$ npm install -g aws-cdk-local aws-cdk
1414...
1515$ cdklocal --version
@@ -21,6 +21,13 @@ $ cdklocal --version
2121
2222(Note: Depending on your local setup, you may or may not have to use the global ` npm ` installation flag ` -g ` above.)
2323
24+ ### Mac OS specific ` MODULE_NOT_FOUND ` issue
25+ On Mac OS, brew can be used to install AWS CDK, which might result in a ` MODULE_NOT_FOUND ` error from ` cdklocal ` .
26+ To resolve this, set the ` NODE_PATH ` variable pointing to your AWS CDK's ` node_module ` folder to expand the lookup path for modules.
27+ ``` bash
28+ $ export NODE_PATH=$NODE_PATH :/opt/homebrew/Cellar/aws-cdk/< CDK_VERSION> /libexec/lib/node_modules
29+ ```
30+
2431## Configurations
2532
2633The following environment variables can be configured:
@@ -35,19 +42,19 @@ The following environment variables can be configured:
3542## Deploying a Sample App
3643
3744The CDK command line ships with a sample app generator to run a quick test for getting started:
38- ```
45+ ``` bash
3946$ mkdir /tmp/test; cd /tmp/test
4047$ cdklocal init sample-app --language=javascript
4148...
4249```
4350
4451Make sure that LocalStack is installed and started up with the required services:
45- ```
52+ ``` bash
4653$ SERVICES=serverless,sqs,sns localstack start
4754```
4855
4956Then deploy the sample app against the local APIs via the ` cdklocal ` command line:
50- ```
57+ ``` bash
5158$ cdklocal deploy
5259...
5360Do you wish to deploy these changes (y/n)? y
@@ -57,7 +64,7 @@ arn:aws:cloudformation:us-east-1:000000000000:stack/TestStack/e3debc0a-311e-4968
5764```
5865
5966Once the deployment is done, you can inspect the created resources via the [ ` awslocal ` ] ( https://github.com/localstack/awscli-local ) command line:
60- ```
67+ ``` bash
6168$ awslocal sns list-topics
6269{
6370 " Topics" : [
@@ -70,6 +77,7 @@ $ awslocal sns list-topics
7077
7178## Change Log
7279
80+ * 2.18.1: Throw better exception if ` aws-cdk ` not found
7381* 2.18.0: Add support for AWS_ENDPOINT_URL, USE_SSL, and BUCKET_MARKER_LOCAL configurations
7482* 2.17.0: Fix IPv4 fallback check to prevent IPv6 connection issue with ` localhost ` on macOS
7583* 2.16.0: Add check to prevent IPv6 connection issue with ` localhost ` on MacOS
0 commit comments