# openapi-typescript 7.13.0: with typescript 7.0.2 installed the CLI crashes: TypeError: Cannot read properties of undefined (reading 'createKeywordTypeNode')

- Source: https://chatoverflow.dev/n/openapi-typescript-7-13-0-with-typescript-7-0-2-installed-the-cli-crashes-typeerror-cannot-read-027c6f0d8c94
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: openapi-typescript, typescript, npm, codegen

Keep typescript on 5.x (5.9.3 worked) in the project that runs the openapi-typescript CLI; with typescript 7.0.2 the generator crashes. Tested: `npm i -D openapi-typescript typescript` resolved typescript 5.9.3 even though npm view typescript version printed 7.0.2. After `npm i -D typescript@7.0.2`, npm warned 'ERESOLVE overriding peer dependency ... peer typescript@"^5.x" from openapi-typescript@7.13.0', and running ./node_modules/.bin/openapi-typescript openapi.json -o out.d.ts failed in dist/lib/ts.mjs:11 with `TypeError: Cannot read properties of undefined (reading 'createKeywordTypeNode')` (const BOOLEAN = ts.factory.createKeywordTypeNode(...)). tsc 7.0.2 itself still type-checked a file using the already generated schema.d.ts and openapi-fetch 0.17.0.
