vercel/next.js · error · Error
It looks like you're trying to use TypeScript but do not hav
Error message
It looks like you're trying to use TypeScript but do not have the required package(s) installed.
Please install ${packagesHuman} by running:
${install command} ${packagesCli}
If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your app and pages directories). What it means
Thrown by missingDepsError() when Next.js detects a tsconfig.json (or .ts files) but the `typescript` (and/or related) package is not installed in node_modules. Next.js requires TypeScript as a peer/dev dependency to type-check and compile .ts routes; without it the build cannot proceed.
Source
Thrown at packages/next/src/lib/typescript/missingDependencyError.ts:23
import { getPkgManager } from '../helpers/get-pkg-manager'
export function missingDepsError(
dir: string,
missingPackages: MissingDependency[]
): never {
const packagesHuman = getOxfordCommaList(missingPackages.map((p) => p.pkg))
const packagesCli = missingPackages.map((p) => p.install ?? p.pkg).join(' ')
const packageManager = getPkgManager(dir)
const removalMsg =
'\n\n' +
bold(
'If you are not trying to use TypeScript, please remove the ' +
cyan('tsconfig.json') +
' file from your package root (and any TypeScript files in your app and pages directories).'
)
throw new Error(
bold(
red(
`It looks like you're trying to use TypeScript but do not have the required package(s) installed.`
)
) +
'\n\n' +
bold(`Please install ${bold(packagesHuman)} by running:`) +
'\n\n' +
`\t${bold(
cyan(
(packageManager === 'yarn'
? 'yarn add --dev'
: packageManager === 'pnpm'
? 'pnpm install --save-dev'
: 'npm install --save-dev') +
' ' +
packagesCli
)View on GitHub (pinned to 0ae8c72462)
Solutions
- Run the exact install command shown in the message (e.g. `npm install --save-dev typescript @types/react @types/node`).
- If you did not intend to use TypeScript, delete tsconfig.json and any .ts/.tsx files in app/ and pages/ directories.
- In a monorepo, ensure typescript resolves from the project root (check pnpm hoisting / yarn workspaces).
Example fix
// before: tsconfig.json exists but typescript not installed // after: run // npm install --save-dev typescript @types/react @types/node @types/react-dom
Defensive patterns
Strategy: validation
Validate before calling
import { existsSync } from 'fs'
import { resolve } from 'path'
function ensureTypeScriptInstalled(projectDir: string) {
if (!existsSync(resolve(projectDir, 'node_modules/typescript/package.json'))) {
throw new Error('typescript is not installed. Run: npm install --save-dev typescript')
}
} Prevention
- Keep typescript and @types/* in devDependencies.
- Run `npm install` (including devDependencies) after cloning.
- In monorepos, verify typescript resolves from the project root.
- Remove tsconfig.json if you are not using TypeScript.
When it happens
Trigger: Project has a tsconfig.json or .tsx pages but `typescript` is absent from dependencies. Triggered by hasNecessaryDependencies during dev/build startup. The error lists the exact missing packages and the correct install command for your detected package manager (npm/yarn/pnpm).
Common situations: Cloning a repo and forgetting `npm install` for devDependencies; using a monorepo where typescript is hoisted incorrectly; deleting node_modules partially; starting from a JS template and adding .ts files without installing typescript.
Related errors
- Could not parsetsconfig.json. Please make sure it contains s
- It looks like you're trying to use Partytown with next/scrip
- Command failed: ${command} ${args.join(' ')} (exit ${code})
- Missing ${NEXT_BIN}. Build Next.js first (pnpm --filter=next
- Command failed: ${command} ${args.join(' ')} (exit ${code})
AI-assisted analysis of vercel/next.js@0ae8c72462 (2026-08-06).
Data as JSON: /api/errors/5d09f9bc4660f95a.
Report an issue: GitHub.