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

C# cdktf init fails on windows with spaces in directory name #500

Closed
mikeparker opened this issue Jan 16, 2021 · 8 comments · Fixed by #511
Closed

C# cdktf init fails on windows with spaces in directory name #500

mikeparker opened this issue Jan 16, 2021 · 8 comments · Fixed by #511
Labels
bug Something isn't working cdktf-cli windows

Comments

@mikeparker
Copy link

mikeparker commented Jan 16, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

cdktf & Language Versions

0.1.0 (2 days old)

Debug Output

https://gist.github.com/mikeparker/d370bf3ab24d8c75c2af25fed0dbce08

In particular note this line is not surrounded by quotes Error: Command failed: "C:\Program Files\nodejs\node.exe" C:\Users\Mike Parker\AppData\Roaming\npm\node_modules\cdktf-cli\bin\cdktf get

Expected Behavior

It should complete

Actual Behavior

It errored

Steps to Reproduce

Follow the C# instructions, i.e. run cdktf init --template="csharp" --local after installing terraform, cdktf

Important Factoids

Windows, node modules in a directory path with whitespace in the name

@mikeparker mikeparker added the bug Something isn't working label Jan 16, 2021
@jsteinich
Copy link
Collaborator

I suspect that this is a problem for all (or mostly all) supported languages.

@mikeparker did you install cdktf-cli just for your user?

@mikeparker
Copy link
Author

@jsteinich I followed the readme instructions to the letter, so I ran npm install -g cdktf-cli. I'm no node expert but a quick google says that should install globally? Is that affected by whether I'm running the command in an admin console?

@jsteinich
Copy link
Collaborator

Is that affected by whether I'm running the command in an admin console?

I'm thinking it is.

@skorfmann
Copy link
Contributor

Is that affected by whether I'm running the command in an admin console?

I'm thinking it is.

Is there something we could improve in the readme instructions?

@skorfmann
Copy link
Contributor

@mikeparker were you able to fix this by running it in the admin console? Or is this related to #502 as the issue title suggests?

@mikeparker
Copy link
Author

No, installing using admin console seems to install the npm module to the same place. According to this stack overflow this directory is normal even for global https://stackoverflow.com/a/26894197/1554346

The TMP env var workaround doesnt work either. However, despite the error, I still get files appearing, which can compile and I can run synth using the TMP workaround, but I'm unsure if the resulting file contents are expected?

{
  "//": {
    "metadata": {
      "version": "0.1.0",
      "stackName": "hello-terraform2"
    }
  }
}

@jsteinich
Copy link
Collaborator

I think it's just a matter of quoting the cdktf calls in the init templates. I'll try to get a PR made in the next couple of days.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2022

I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working cdktf-cli windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants