I am trying to deploy backend serverless resources with CDK in AWS cloud but getting errors while deploying things via GitLab build. trying with a local visual studio it works fine.
error is below :
$ npm run deploy-backend
> ui-dashboard-infra@0.0.0 deploy-backend /builds/project/control-panel/infra
> cdk deploy --app 'ts-node stacks/backend' --all --require-approval never
Bundling asset dashboard-A/restFunctionFallbackus-east-1/Code/Stage...
/builds/project/control-panel/infra/node_modules/@aws-cdk/core/lib/asset-staging.ts:398
throw new Error(`Failed to bundle asset ${this.node.path}, bundle output is located at ${bundleErrorDir}: ${err}`);
^
Error: Failed to bundle asset dashboard-A/restFunctionFallbackus-east-1/Code/Stage, bundle output is located at /builds/project/control-panel/infra/cdk.out/bundling-temp-4607286efdd890681baca6f8a5d9b9b32929fa84e9947500fbe203e5b5d06a0f-error: Error: spawnSync bash ENOENT
at AssetStaging.bundle (/builds/project/control-panel/infra/node_modules/@aws-cdk/core/lib/asset-staging.ts:398:13)
at AssetStaging.stageByBundling (/builds/project/control-panel/infra/node_modules/@aws-cdk/core/lib/asset-staging.ts:246:10)
at stageThisAsset (/builds/project/control-panel/infra/node_modules/@aws-cdk/core/lib/asset-staging.ts:137:35)
at Cache.obtain (/builds/project/control-panel/infra/node_modules/@aws-cdk/core/lib/private/cache.ts:24:13)
at new AssetStaging (/builds/project/control-panel/infra/node_modules/@aws-cdk/core/lib/asset-staging.ts:162:44)
at new Asset (/builds/project/control-panel/infra/node_modules/@aws-cdk/aws-s3-assets/lib/asset.ts:68:21)
at AssetCode.bind (/builds/project/control-panel/infra/node_modules/@aws-cdk/aws-lambda/lib/code.ts:180:20)
Subprocess exited with error 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ui-dashboard-infra@0.0.0 deploy-backend: `cdk deploy --app 'ts-node stacks/backend' --all --require-approval never`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ui-dashboard-infra@0.0.0 deploy-backend script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-08-10T08_29_17_449Z-debug.log