question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cdktf init fails at npm install (NODE_ENV is not recognized)

See original GitHub issue

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.0.11 and the typescript template

Debug Output

Figure it’s short enough to be here (just few lines):

$ cdktf init --template="typescript" --local
Note: By supplying '--local' option you have chosen local storage mode for storing the state of your stack.
This means that your Terraform state file will be stored locally on disk in a file 'terraform.tfstate' in the root of your project.

We will now setup the project. Please enter the details for your project.
If you want to exit, press ^C.

Project Name: (default: 'tfcdk')
Project Description: (default: 'A simple getting started project for cdktf.')
'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.

<cut command line options for cdktf displayed>

Error: Command failed: NODE_ENV=development npm install  cdktf@^0.0.11 constructs@^3.0.0
    at checkExecSyncError (child_process.js:630:11)
    at execSync (child_process.js:666:15)
    at installDeps (path\to\npm\node_modules\cdktf-cli\templates\typescript\.hooks.sscaff.js:30:3)

Expected Behavior

No error when doing an init

Actual Behavior

Init fails at the npm install step

Steps to Reproduce

npm i cdktf -g
cdktf init --template="typescript" --local

Important Factoids

Running on Windows 10, Node 12.16.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:18 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
rrazielcommented, Jul 17, 2020

Could you give cdktf-cli@next a shot? (npm install -g cdktf-cli@next) It should fix the init issues on Windows

Just tested now, it works.

1reaction
skorfmanncommented, Jul 17, 2020

Could you give cdktf-cli@next a shot? (npm install -g cdktf-cli@next) It should fix the init issues on Windows

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cdktf get don't work on a new python project - CDK for Terraform
after the first configuration of a pipenv project. when i do a cdktf get. env. terraform: 1.0.7 node 12.16 python: 3.8. cdktf.json.
Read more >
How to fix 'command not found' for aws-cdk after running the ...
I am trying to install the aws-cdk and in the terminal and I run the npm install -g aws-cdk . As stated here...
Read more >
Unable to complete "cdktf init --template=python - r/Terraform
I was supposed to run the command: cdktf init --template=python --local But when it gets in this line it fails: pipenv install cdktf~=0.4.1 ......
Read more >
nodeenv - npm
nodeenv enables tests to control Node.js environment variables. ... Start using nodeenv in your project by running `npm i nodeenv`.
Read more >
homebrew-core - Homebrew Formulae
a2ps 4.14 Any‑to‑PostScript filter aacgain 1.8 AAC‑supporting version of mp3gain aalib 1.4rc5 Portable ASCII art graphics library aamath 0.3 Renders mathematical expressions as ASCII art
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found