Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw somewhat better exception if aws-cdk is missing #92

Merged
merged 3 commits into from
Sep 26, 2024

Conversation

lakkeger
Copy link
Contributor

@lakkeger lakkeger commented Jul 1, 2024

Motivation

In case of aws-cdk is installed by a different package manager (ie brew on Mac OS) as a separate CLI tool cdklocal complains that the aws-cdk module is missing. To resolve this situation I found that the easiest solution is to add it by the NODE_PATH variable that expands the lookup path for modules. (docs)

If the NODE_PATH environment variable is set to a colon-delimited list of absolute paths, then Node.js will search those paths for modules if they are not found elsewhere.

Reported issue: #90

Changes

  • update README
  • add small message to exception

Copy link
Member

@dominikschubert dominikschubert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for improving the documentation/error reporting on failed imports. Had a few nits but nothing major blocking a merge.

bin/cdklocal Outdated Show resolved Hide resolved
bin/cdklocal Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@lakkeger lakkeger merged commit 3704bb4 into main Sep 26, 2024
12 checks passed
@lakkeger lakkeger deleted the missing_aws_cdk_exception branch September 26, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: Cannot find module 'aws-cdk/lib/api/aws-auth' when using CDK installed with homebrew
2 participants