Render deploy failing: TS2688 Cannot find type definition file for 'node' (Node.js 22.16.0 + TypeScript 5.8.3)

error TS2688: Cannot find type definition file for 'node'.

{
  "name": "server",
  "version": "1.0.0",
  "main": "dist/index.js",
  "type": "module",
  "types": "dist/index.d.ts",
  "typings": "dist/index.d.ts",
  "scripts": {
    "dev": "tsx watch src/index.ts",
    "build": "tsc",
    "start": "node dist/index.js",
    "clean": "rimraf dist",
    "postinstall": "prisma generate",
    "fly:deploy": "fly deploy",
    "fly:logs": "fly logs",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "description": "",
  "dependencies": {
    "@prisma/client": "^6.14.0",
    "@types/node": "^24.3.0",
    "cloudinary": "^2.7.0",
    "cors": "^2.8.5",
    "dotenv": "^17.2.1",
    "express": "^5.1.0",
    "multer": "^2.0.2",
    "rimraf": "^6.0.1",
    "typescript": "^5.9.2"
  },
  "devDependencies": {
    "@types/cors": "^2.8.19",
    "@types/express": "^5.0.3",
    "@types/multer": "^2.0.0",
    "prisma": "^6.14.0",
    "tsx": "^4.20.3"
  }
}

{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "moduleResolution": "node",
    "outDir": "./dist",
    "rootDir": "./src",
    "strict": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "declaration": true,
    "sourceMap": true,
    "resolveJsonModule": true,
    "lib": ["ES2020"],
    "types": ["node"],
    "typeRoots": ["./node_modules/@types"]
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "dist"]
}

r/typescript - Render deploy failing: TS2688 Cannot find type definition file for 'node' (Node.js 22.16.0 + TypeScript 5.8.3)|750xauto

I’m trying to deploy my backend on Render.com using TypeScript and Express. The build keeps failing with this error: error TS2688: Cannot find type definition file for 'node'.

The file is in the program because:

Entry point of type library 'node' specified in compilerOptions

I’ve already tried uninstalling and reinstalling @/types/node, and I also added it as a dependency, but the issue persists during deployment.

Has anyone run into this problem before? How can I fix the missing type definitions issue on Render?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.