aws-cdk: aws cdk commands fail with error "Subprocess exited with error null"

Describe the bug

When I run any cdk command, it fails with the following error and exit code 1: Subprocess exited with error null No extra helpful information is printed out. However, when I use --verbose it raises the following info Example running cdk ls --verbose :

[14:56:39] Reading cached notices from /Users/{user}/.cdk/cache/notices.json

Subprocess exited with error null
[14:56:39] Error: Subprocess exited with error null
    at ChildProcess.<anonymous> (/Users/{user}/.nvm/versions/node/v18.19.0/lib/node_modules/aws-cdk/lib/index.js:423:50595)
    at ChildProcess.emit (node:events:517:28)
    at ChildProcess.emit (node:domain:489:12)
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)

Expected Behavior

List stacks or show a more helpful error message.

Current Behavior

Fails with subprocess exited with error null

Reproduction Steps

I have been able to run cdk ls, synth and deploy in other repository’s, but not this one

Possible Solution

No response

Additional Information/Context

I have tried different combinations of version of node (20, 14) , npm, and aws-cdk but still running into the same issue. I am able to run cdk and deploy this same code/repo on a windows machine I am using pyenv and nvm for version management, and running these cdk commands within a python poetry environment

CDK CLI Version

2.118

Framework Version

No response

Node.js Version

18.19.0

OS

Mac Sonoma 14.2.1

Language

Python

Language Version

3.8.10

Other information

No response

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Finally got the commands to run… I upgraded python from 3.8.10 to 3.12 and updated some of the package dependencies…that seemed to do it Thanks for your help.