Skip to content

aws-lambda: Error when bundling due to spawnSync #37387

@oceanofmaya

Description

@oceanofmaya

Describe the bug

After installing version 2.245.0 I receive the following error when I execute CDK snapshots or running cdk synth/watch on my Windows machine. It works fine in versions before that.

Failed to bundle asset ..., bundle output is located at ...\cdk.out.temp\bundling-temp-e98a665278e5ab86e3563dd5685700fd07e9d2f33c1363861fee27f22f55690e-building: Error: spawnSync npx.cmd EINVAL

It might be related to the below change in version 2.245.0:

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Library Version

2.244.0

Expected Behavior

Bundling of assets work as expected without any issues

Current Behavior

When bundling is attempted, it fails with the error "Error: spawnSync npx.cmd EINVAL"

Reproduction Steps

Using aws-cdk-lib version 2.245.0, run a unit test to generate a snapshot or run cdk synth

Possible Solution

Reevaluate the change done in 2.245.0 related to the spawning

lambda-nodejs: use direct spawn for local bundling (#37292) (9bf4263)

Additional Information/Context

No response

AWS CDK Library version (aws-cdk-lib)

2.245.0

AWS CDK CLI version

2.1114.1

Node.js Version

22

OS

Windows

Language

TypeScript

Language Version

5.9.3

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-lambdaRelated to AWS LambdabugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.p0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions