Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-cdk: cannot spawn node shell if path has spaces #25729

Closed
kahlstrm opened this issue May 24, 2023 · 5 comments
Closed

aws-cdk: cannot spawn node shell if path has spaces #25729

kahlstrm opened this issue May 24, 2023 · 5 comments
Assignees
Labels
bug This issue is a bug. effort/medium Medium work item – several days of effort p2 package/tools Related to AWS CDK Tools or CLI

Comments

@kahlstrm
Copy link

Describe the bug

If you have node installed to e.g. ~/Library/Application Support/fnm/.., the subprocess fails with
/bin/sh: /Users/example/Library/Application: No such file or directory.

Expected Behavior

running e.g. cdk diff should work properly

Current Behavior

~ » cdk diff
/bin/sh: /Users/example/Library/Application: No such file or directory

Subprocess exited with code 127

Reproduction Steps

  • Have node installed in path that contains space somewhere
  • Run some command that uses execProgram (e.g. cdk diff)
  • should fail.

Possible Solution

This problem occurring has been discussed here quite extensively.

Solution for this is to either do shell: false which of the effects I'm unsure of, or wrap the first argument of the execution arguments with quotes.

Additional Information/Context

No response

CDK CLI Version

2.80.0 (build bbdb16a)

Framework Version

No response

Node.js Version

v18.16.0

OS

macOS Ventura 13.3.1 (a)

Language

Typescript

Language Version

No response

Other information

No response

@kahlstrm kahlstrm added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 24, 2023
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label May 24, 2023
@peterwoodworth peterwoodworth added p1 effort/small Small work item – less than a day of effort needs-review and removed needs-triage This issue or PR still needs to be triaged. labels May 24, 2023
@peterwoodworth
Copy link
Contributor

Thanks for reporting this and linking to the relevant thread, we'll take a look at this

@cufarvid
Copy link

As a workaround, if you're using fnm, you can change the default installation directory to something like ~/.fnm by setting the FNM_DIR evironment variable.

@vinayak-kukreja vinayak-kukreja self-assigned this Apr 24, 2024
@vinayak-kukreja
Copy link
Contributor

Related: #28582

@vinayak-kukreja vinayak-kukreja added p2 effort/medium Medium work item – several days of effort and removed p1 effort/small Small work item – less than a day of effort labels May 7, 2024
@vinayak-kukreja
Copy link
Contributor

Hey, thank you for reporting this issue.

This issue as mentioned is being caused by a space being present in the path for node executable. Looking at node github repository issues, it looks like this is a known issue with how node handles spaces in paths. And for CDK, this occurs here.

We currently do not have any plans to fix this on our end. Our recommendation for a workaround here would be to install node at a path which does not have spaces in it.

Copy link

github-actions bot commented May 7, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. effort/medium Medium work item – several days of effort p2 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants