-
Notifications
You must be signed in to change notification settings - Fork 17
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
Error: Cannot find module 'aws-cdk/lib/api/aws-auth' when using CDK installed with homebrew #90
Comments
Hi @AllanOricil! |
@lakkeger if I do it, NVM will probably break. I use multiple node versions, in multiple projects, so I can't break NVM |
The issue you experience in general not a bug in aws-cdk-local but a module look up issue with NodeJS. Our assumption by default is that node knows well where to look up the necessary packages, in this case aws-cdk. Since you've installed it with brew this is not the case.
ref: https://nodejs.org/api/modules.html#loading-from-the-global-folders So in context of the above I see no value in it to implement something that we can work around with a small config change. If you are still worried, I'd recommend to use something like direnv/nix/devcontainers to separate project environments completely not just on the node level so your NODE_PATH can be unloaded/loaded by every project. (Perhaps the easiest to implement it without big changes is direnv.) |
@lakkeger why not print a message on the terminal to guide users to update NODE_PATH? The main issue is that I got lost and had no directions, and had to wait weeks for you to help me "we identified cdk packages are not installed in the same directory as localstack. Please, update NODE_PATH with the path where cdk modules are installed running the following command ..." |
I understand your frustration and our team is working on it tirelessly to improve the product and the UX/DX of the surrounding ecosystem. Unfortunately there was only best effort support and development on this repo for a long time.
|
Just to add onto this error, it's not just related to a homebrew install. I have the same issue having installed cdk-local with npm. |
Hi @rdingwell, |
@lakkeger I found my issue when looking through my .npm directory. You can install cdk in a couple of ways using npm, either with |
It does not work with cdk installed via homebrew
The required libraries should be fetched after determining the CDK installation, as people could have not installed it with npm.
You could also try to publish this cli to the homebrew registry. This way you can require homebrew's global node modules, I think
The text was updated successfully, but these errors were encountered: