DEV Community

Fixing Error spawnSync bash ENOENT occurring during CDK Lambda Bundling on CI pipeline

Davide de Paolis on April 14, 2023

TLDR; if you are struggling with spawnSync bash ENOENT. at AssetStaging.bundle Error when bundling a Lambda function check out the bund...
Collapse
 
tacsiazuma profile image
Krisztian Papp

The issue with your build is that the docker image you are using does not have 'bash', only 'sh' (likely an alpine based one).
It tried to spawn a bash shell but it was not found:
Error: spawnSync bash ENOENT.
Use a docker image which is not alpine based, like node:20.

Collapse
 
mikey profile image
Mikey Battiston

ty ty ty ty ty ty ty ty ty ty ty ty. You saved me!