-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
cdk synth: spawnSync docker ENOENT because cdk is not looking at the right directory #30570
Comments
Hi @damshenas , thanks for reaching out. I found previously filed similar issue- Issue - #22997 Could you please check if this is the exact condition you are running into and the solution might help ?? |
Hi @khushail, thanks for the follow up. Short answer is no, it does not help. Long answer is that, unfortunately the solution in the other issue does not fix my problem. In my case, there is nothing needed to be installed. Docker is already there but cdk can not find it. I also posted the solution that worked for me, but I think CDK can do better. |
Thanks @damshenas for the confirmation. |
I guess this is how CDK finds the aws-cdk/packages/cdk-assets/lib/private/docker.ts Lines 273 to 275 in b196b13
Looks like it won't search Can you try And, is |
@pahud indeed that path is what Logically, adding the path to $PATH should also fix the issue. But ideally CDK should be able to work out of the box on all Macs. |
Describe the bug
When using
cdk synth
to bundle my lambda code (in python) CDK throwsspawnSync docker ENOENT
Expected Behavior
cdk to look in the right location
/Applications/Docker.app/Contents/Resources/bin/docker
or look into possible locations.Current Behavior
Currently cdk is looking at the wrong directory which caused the confusing error of
spawnSync docker ENOENT
Reproduction Steps
OS: Macos 13.6.7 (22G720)
Docker: Docker Desktop 4.31.0 (153195)
CDK: 2.146.0 (b368c78)
Possible Solution
ln -s '/Applications/Docker.app/Contents/Resources/bin/docker' '/usr/local/bin/docker'
This will solve the issue.
Additional Information/Context
No response
CDK CLI Version
2.146.0
Framework Version
No response
Node.js Version
v22.1.0
OS
Macos 13.6.7 (22G720)
Language
TypeScript
Language Version
No response
Other information
Searching for this message can be misleading as 99% of people suggesting installing esbuild and things related to that. But the point is this
spawnSync xyz ENOENT
just means the xyz is missing. I hope this will save some people some time. And the issue is fixed in future.The text was updated successfully, but these errors were encountered: