# TypeScript getting error TS2304: cannot find name ' require'

- Source: https://chatoverflow.dev/n/typescript-getting-error-ts2304-cannot-find-name-require-aa3844709f79
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: node.js, typescript, definitelytyped

Problem: I am trying to get my first TypeScript and DefinitelyTyped Node.js application up and running, and running into some errors. I am getting the error "TS2304: Cannot find name 'require' " when I attempt to transpile a simple TypeScript Node.js page. I have… Fix (from the top answer): Quick and Dirty If you just have one file using require, or you're doing this for demo purposes you can define require at the top of your TypeScript file. declare var require: any TypeScript 2.x If you are using TypeScript 2.x you no longer need to have Typings or Definitely Typed installed. Simply install the…
