terraform-cdk: Python cdktf get - Cannot find abortsignal
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
cdktf-cli: 0.7.0 Node: v14.17.0 Python: 3.8.5 Terraform: v1.0.9 OS: Windows 11
Affected Resource(s)
Debug Output
Running cdktf get in my project with the following cdktf.json file:
{
"language": "python",
"app": "python ./main.py",
"terraformProviders": [
"google@=3.88"
],
"terraformModules": [],
"codeMakerOutput": "imports",
"context": {
"excludeStackIdFromLogicalIds": "true",
"allowSepCharsInLogicalIds": "true"
}
}
I’m getting the following output:
cdktf get
NOTE: Temp directory retained due to an error: C:\Users\danie\AppData\Local\Temp\temp-UsIzjn
Error: jsii compilation failed with non-zero exit code: 1
| [2021-10-22T21:39:26.005] [ERROR] jsii/compiler - Compilation errors prevented the JSII assembly from being created
| warning JSII6: A "peerDependency" on "constructs" at "10.0.9" means you should take a "devDependency" on "constructs" at "10.0.9" (found "undefined")"
| warning JSII6: A "peerDependency" on "cdktf" at "0.7.0" means you should take a "devDependency" on "cdktf" at "0.7.0" (found "undefined")"
| warning JSII3: There is no "README.md" file. It is required in order to generate valid PyPI (Python) packages.
| node_modules/@types/node/child_process.d.ts:267:18 - error TS2304: Cannot find name 'AbortSignal'.
|
| 267 signal?: AbortSignal | undefined;
| ~~~~~~~~~~~
+----------------------------------------------------------------------------------
| Command: C:\Users\danie\AppData\Roaming\npm\node_modules\cdktf-cli\node_modules\jsii\bin\jsii --silence-warnings reserved-word
| Workdir: C:\Users\danie\AppData\Local\Temp\temp-UsIzjn
+----------------------------------------------------------------------------------
at newError (C:\Users\danie\AppData\Roaming\npm\node_modules\cdktf-cli\node_modules\@skorfmann\jsii-srcmak\lib\util.js:58:20)
at ChildProcess.<anonymous> (C:\Users\danie\AppData\Roaming\npm\node_modules\cdktf-cli\node_modules\@skorfmann\jsii-srcmak\lib\util.js:75:29)
at Object.onceWrapper (events.js:483:26)
at ChildProcess.emit (events.js:376:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
⠦ downloading and generating modules and providers...
jsii compilation failed with non-zero exit code: 1
| [2021-10-22T21:39:26.005] [ERROR] jsii/compiler - Compilation errors prevented the JSII assembly from being created
| warning JSII6: A "peerDependency" on "constructs" at "10.0.9" means you should take a "devDependency" on "constructs" at "10.0.9" (found "undefined")"
| warning JSII6: A "peerDependency" on "cdktf" at "0.7.0" means you should take a "devDependency" on "cdktf" at "0.7.0" (found "undefined")"
| warning JSII3: There is no "README.md" file. It is required in order to generate valid PyPI (Python) packages.
| node_modules/@types/node/child_process.d.ts:267:18 - error TS2304: Cannot find name 'AbortSignal'.
|
| 267 signal?: AbortSignal | undefined;
| ~~~~~~~~~~~
+----------------------------------------------------------------------------------
| Command: C:\Users\danie\AppData\Roaming\npm\node_modules\cdktf-cli\node_modules\jsii\bin\jsii --silence-warnings reserved-word
| Workdir: C:\Users\danie\AppData\Local\Temp\temp-UsIzjn
+----------------------------------------------------------------------------------
Expected Behavior
Actual Behavior
Steps to Reproduce
Important Factoids
References
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 18 (3 by maintainers)
Interesting I did try installing @types/node globally and that had no effect for me. I’ll give this a try tomorrow 🙂 unless @GnokGnik can confirm that works sooner
Found a possible workaround (worked for me):
Commandmentioned near the bottom of the error messages. Should containnpm\node_modules\cdktf-cli(stop once incdktf-cli))npm install @types/node@14.17.27I’m also having the same issue. Terraform v1.0.9 Python 3.10.0 Node.js v14.18.1.
This also happened to me, when i did
cdktf get. It feels like nothing was happening and was “stuck” atdownloading and generating modules. What i did was just to wait it out.Now, it is my first time working on cdktf / terraform so im not sure if this “long wait” on
cdktf getis normal or not.Glad its not just me, been trying to build some cdktf docker containers and I was completely baffled by this. I checked the temp directory created in the error and can confirm I don’t see any readme file (so the warnings seem all valid). I also updated to the latest LTS nodejs version like you and yup still the same error.