terraform-cdk: cdktf init fails at npm install (NODE_ENV is not recognized)

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

About this issue

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

Most upvoted comments

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.

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

Next problem is yarn, which I don’t have, is it mandatory or it should init without yarn?

Error:

'yarn' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! terraform-vm-test@1.0.0 build: `yarn get && tsc`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the terraform-vm-test@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xxx\AppData\Roaming\npm-cache\_logs\2020-07-17T11_25_51_330Z-debug.log
cdktf init [OPTIONS]