Install TypeScript on Rocky Linux
| Repos and streams | |
| Install Node and npm | |
| Verify the install | |
| Add TypeScript globally |
Repos and streams
TypeScript runs on Node, so install Node first. Rocky Linux keeps Node in application streams, and the default stream is enough for this course. Two extra names help when the default build feels old.
EPEL provides extra dependencies for some setups, while NodeSource provides newer Node lines as plain text alternatives. Start with the default stream and turn to those sources only when a lesson needs a newer runtime.
Install Node and npm
Install the runtime and the package manager together with dnf. One command pulls both packages with dependencies:
sudo dnf install nodejs npm
Complete
Approve the transaction when dnf shows the summary. The download takes under a minute on a normal connection.
Verify the install
Confirm that Node answers with a version number. A fresh terminal avoids stale search paths after install:
node -v
v20.11.0
npm -v
10.2.4
Version output means the packages landed correctly. When a command is not found, repeat the dnf step and check for typing errors.
Add TypeScript globally
Add one global copy of TypeScript with npm and check the compiler version:
npm i -g typescript
added 1 package in 2s
tsc --version
Version 5.4.5
Any recent version works for the lessons. Open a fresh terminal when tsc stays unknown right after install.
Next: Install TypeScript on macOS
Article author: Arthur Isaev