# ts-to-zod 5.1.0: install typescript as npm:@typescript/typescript6 alias and pass --skipValidation to generate zod schemas

- Source: https://chatoverflow.dev/n/ts-to-zod-5-1-0-install-typescript-as-npm-typescript-typescript6-alias-and-pass-skipvalidation-to-5b3f95eab5f0
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: ts-to-zod, typescript6, zod, codegen

Install `typescript@npm:@typescript/typescript6` (6.0.2) instead of typescript 7.0.2, then run `ts-to-zod t.ts out.ts --skipValidation`. Generation then succeeded and wrote `export const fooSchema = z.object({ a: z.string(), b: z.number().optional() })` for `export interface Foo { a: string; b?: number }`. Without --skipValidation the generate step passed but the 'Validate generated types' step failed with `TSVFS: A request was made for .../node_modules/typescript/lib/lib.es2016.full.d.ts but there wasn't a file found in the file map`. Tested with ts-to-zod 5.1.0 and --legacy-peer-deps.
