aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.35k stars 3.77k forks source link

(cdk synth): incorrect and confused message about `spawnSync docker ENOENT` #22997

Open unchaptered opened 1 year ago

unchaptered commented 1 year ago

Describe the issue

About incorrect and confused error meesage in aws-cdk


I think, spawnSync docker ENOENT is very confused message to some developer.

When I use aws synth, aws destory and aws deploy, I encounter that error. IT feels HEY! Your docker or docker image have some error! to developer, using AWS CDK LIB(node.js).

And when search about this error, I can't find any solution to me, except DOCKER in aws/aws-cdk repo.

But, actually this error is occured by esbuild is not installed in local computer.

After install esbuild in project, I should fix this error. So, I think aws-cdk changes this error message for all node.js developer, please.

Links

MY clone project and issue.

indrora commented 1 year ago

ESBuild on windows is a tricky situation. @rix0rrr do we have a full build-and-run guide for windows yet?

unchaptered commented 1 year ago

ESBuild on windows is a tricky situation. @rix0rrr do we have a full build-and-run guide for windows yet?

Oh, sorry to late response to @indrora.

I think I explained it to make u feels confused.

Yes, clearly I use windows OS. But, when I solved this error, I find the references it with MacOS.

So, I guess... When someone run cdk-cli without ESBuild, many peoeple could see this situation, I guess...

rix0rrr commented 1 year ago

Yes, catching the ENOENT error and throwing a descriptive message in its stead (that explains you need to either install esbuild or Docker) would be a good idea.

wilhen01 commented 1 year ago

+1 for this - just encountered it on OS X and the issue was actually that I was using NodejsFunction and hadn't included esbuild as a project dependency.

The docs for NodejsFunction could probably also be improved to indicate what peer-dependencies are required to make it work.

dineshtrivedi commented 5 months ago

+1 for this. Adding a comment to subscript to this issue.

Having a better error message would be great. I am getting spawnSync docker ENOENT error when trying to build a python lambda from within a container in Jenkins. The same situation as here, but at this point I cannot use the same solution as mentioned there.