# Which TypeScript Version Does LunaTV Use?

> Discover the exact TypeScript version LunaTV utilizes. Find the specific version number declared in the project's package.json file for MoonTechLab/LunaTV.

- Repository: [MoonTechLab/LunaTV](https://github.com/MoonTechLab/LunaTV)
- Tags: getting-started
- Published: 2026-09-08

---

**LunaTV uses TypeScript 4.9.5, explicitly declared in the `devDependencies` section of the project's [`package.json`](https://github.com/MoonTechLab/LunaTV/blob/main/package.json) file.**

The MoonTechLab/LunaTV repository pins its compiler version to ensure consistent type checking and build reproducibility across all development environments. According to the source code analysis, the project specifies version `^4.9.5` in its package manifest, which mandates the minimum compiler version while allowing compatible patch updates.

## TypeScript Version Declaration in package.json

The definitive source for LunaTV's TypeScript version is the [`package.json`](https://github.com/MoonTechLab/LunaTV/blob/main/package.json) file at the repository root. On **line 82** within the `devDependencies` object, the dependency appears as:

```json
{
  "devDependencies": {
    "typescript": "^4.9.5"
  }
}

```

The caret (`^`) in the semantic version string `"^4.9.5"` instructs the package manager to install **at least version 4.9.5**, while automatically accepting newer patch releases within the 4.9 series (such as 4.9.6 or 4.9.7). This constraint prevents automatic upgrades to TypeScript 5.0 or higher, protecting the codebase from unexpected breaking changes in compiler behavior.

## Compiler Configuration via tsconfig.json

While [`package.json`](https://github.com/MoonTechLab/LunaTV/blob/main/package.json) controls which TypeScript compiler binary is installed, the [`tsconfig.json`](https://github.com/MoonTechLab/LunaTV/blob/main/tsconfig.json) file manages how that compiler processes the source code. The configuration file does not override or pin the TypeScript version; instead, it defers to the version specified in the Node.js package manifest. This file defines critical compiler options including `target`, `module`, `strict`, and `paths`, but relies entirely on the [`package.json`](https://github.com/MoonTechLab/LunaTV/blob/main/package.json) declaration to determine which compiler engine executes these rules.

## Verifying the Installed Version Locally

Developers can confirm the active TypeScript version using the project's built-in type-checking script. Running the following command from the repository root invokes the compiler without emitting files:

```bash
pnpm typecheck

```

This executes `npx tsc --noEmit --incremental false` and outputs the version being used:

```text
TypeScript version 4.9.5

```

For a direct version check without running the full type checker, use:

```bash
npx tsc --version

# Version 4.9.5

```

## TypeScript Usage in the LunaTV Codebase

The source files utilize syntax and features fully supported by TypeScript 4.9.5. For example, modules in the `src/` directory employ standard type annotations and ES module patterns:

```typescript
// src/example.ts
export function greet(name: string): string {
  return `Hello, ${name}!`;
}

// Usage in another file
import { greet } from '@/example';
console.log(greet('Luna TV'));

```

This code compiles successfully under the TypeScript 4.9.5 compiler configured in the project.

## Summary

- **LunaTV uses TypeScript 4.9.5** as declared on line 82 of [`package.json`](https://github.com/MoonTechLab/LunaTV/blob/main/package.json).
- The version constraint `"^4.9.5"` permits automatic patch updates while preventing minor or major version jumps.
- The [`tsconfig.json`](https://github.com/MoonTechLab/LunaTV/blob/main/tsconfig.json) file configures compiler behavior but does not override the version specified in [`package.json`](https://github.com/MoonTechLab/LunaTV/blob/main/package.json).
- Run `pnpm typecheck` to verify the active TypeScript version during local development.

## Frequently Asked Questions

### Which exact TypeScript version does LunaTV require?

LunaTV requires **TypeScript 4.9.5** or compatible patches within the 4.9 release line. The `^4.9.5` constraint in [`package.json`](https://github.com/MoonTechLab/LunaTV/blob/main/package.json) ensures the project receives bug fixes and security patches for the 4.9 series without automatically upgrading to TypeScript 5.0, which could introduce breaking changes.

### Where is the TypeScript version defined in the LunaTV repository?

The TypeScript version is defined in **[`package.json`](https://github.com/MoonTechLab/LunaTV/blob/main/package.json)** at the repository root, specifically within the `devDependencies` section on line 82. The project does not pin the compiler version inside [`tsconfig.json`](https://github.com/MoonTechLab/LunaTV/blob/main/tsconfig.json), relying instead on the Node.js package manifest to control the exact version installed in `node_modules`.

### How does LunaTV prevent TypeScript version mismatches?

The project uses a caret-range dependency (`"^4.9.5"`) combined with lock files (such as [`pnpm-lock.yaml`](https://github.com/MoonTechLab/LunaTV/blob/main/pnpm-lock.yaml)) to ensure all developers and CI pipelines use identical compiler versions. When a developer runs `pnpm install`, the lock file guarantees that the exact resolved version of TypeScript 4.9.5 (or the specific patch version tested by maintainers) is installed, regardless of what newer patches might be available in the registry.

### Can I use TypeScript 5.0 or higher with LunaTV?

While the source code might compile with newer versions, the official [`package.json`](https://github.com/MoonTechLab/LunaTV/blob/main/package.json) constraint explicitly prevents automatic installation of TypeScript 5.0 or higher. To maintain compatibility with the project's build pipeline and avoid potential compilation errors, use the version specified in the lock file or manually install `typescript@4.9.5`.