Pin the Version: 5.9.3, Never latest · TypeScript

Ch 1 · Why TypeScript Is Worth Your Time — card 3 of 4.

TypeScript has been rewritten. Version 7 is a new compiler built in Go — much faster, and different enough that a lot of advice written for version 5 no longer lines up with what it does or what it prints. If you install TypeScript today without saying which version you want, you get 7.

Install it deliberately instead. Every project in this course pins:

{
  "devDependencies": {
    "typescript": "5.9.3"
  }
}

Three reasons, and the third is the one that matters most to you:

Note the version string is 5.9.3 with no ^ in front of it. A caret means "5.9.3 or any newer 5.x", which is how a project silently drifts between the machine you built it on and the machine that builds it next month.