Install TypeScript on macOS
| Homebrew note | |
| Install Node | |
| Verify Node and npm | |
| Add TypeScript globally |
Homebrew note
TypeScript runs on Node, so install Node first. On macOS the friendly route is Homebrew, which keeps command line tools in one place with simple update commands.
When Homebrew is already present, update its lists before installing anything new. When it is missing, set it up first with its normal setup flow, then return here for the Node step.
Install Node
Install Node with one Homebrew command. The formula already includes npm, so both tools arrive together:
brew install node
Pouring node...
Wait for the pour and link steps to finish. Open a fresh Terminal window after install so the new paths load correctly.
Verify Node and npm
Confirm that both tools answer with version numbers:
node -v
v20.11.0
npm -v
10.2.4
Version output means the setup worked. When a command is not found, repeat the brew step in a fresh Terminal window.
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 compiler version is fine for this course. Close and reopen Terminal when tsc stays unknown right after install.
Next: Install TypeScript on FreeBSD
Article author: Arthur Isaev