Use this guide if you need a Linux-specific TypeScript install path. If you want the family overview first, start with How to Install TypeScript on Windows, macOS and Linux. For the sibling platform guides, see Windows and macOS.
Quick Answer
- Install Node.js (which includes npm):
sudo apt install nodejs npm -y - Install TypeScript globally:
sudo npm install -g typescript - Verify the installation:
tsc --version - Compile a TypeScript file:
tsc yourfile.ts
Before You Start
TypeScript is distributed through npm, so Linux systems need Node.js first. On most distributions, the fastest route is to install Node.js and npm from the native package manager, then install TypeScript globally or per project.
Install Node.js on Debian and Ubuntu
sudo apt update
sudo apt install -y nodejs npm
node -v
npm -vInstall Node.js on Fedora, RHEL, Rocky Linux and AlmaLinux
sudo dnf install -y nodejs npm
node -v
npm -vInstall Node.js on Other Linux Distributions
Use your platform package manager if you are on Arch Linux, openSUSE, or another distribution. For example:
sudo pacman -S nodejs npmInstall TypeScript Globally
Once Node.js and npm are installed, add the TypeScript compiler globally:
npm install -g typescript
tsc -vThis gives you the tsc command system-wide.
Install TypeScript Per Project
If you want a project-local compiler version, initialize a project directory and install TypeScript as a development dependency:
mkdir my-typescript-project
cd my-typescript-project
npm init -y
npm install --save-dev typescript
npx tsc --initCompile a Test File
Create a quick file and verify the compiler works as expected:
echo 'const message: string = "TurboGeek";' > hello.ts
tsc hello.ts
lsYou should now see hello.js alongside the TypeScript file.
Troubleshooting on Linux
- Old Node.js packages: some long-term-support distributions ship older Node.js versions. If you need a newer compiler toolchain, consider the NodeSource repository or a version manager such as
nvm. tscnot found: confirm the global npm binary path is in your shell PATH or runnpx tscinside a project.- Permission issues: avoid using
sudo npm install -gunless you understand the ownership impact. A version manager is often cleaner for dev workstations.
Related TypeScript Guides
- TypeScript install hub for all platforms
- How to Install TypeScript on Windows
- How to Install TypeScript on macOS
After TypeScript is installed on Linux, the next improvement is usually creating a tsconfig.json, choosing a package manager workflow, and integrating compilation into your build or CI pipeline.

