A few tips in order

  • restart the terminal
  • restart the machine
  • reinstall nodejs + then run npm install typescript -g

If it still doesn't work run npm config get prefix to see where npm install -g is putting files (append bin to the output) and make sure that they are in the path (the node js setup does this. Maybe you forgot to tick that option).

Answer from basarat on Stack Overflow
🌐
TypeScript
typescriptlang.org › docs › handbook › 2 › basic-types.html
TypeScript: Documentation - The Basics
All of this is built on top of the type-checker and is fully cross-platform, so it’s likely that your favorite editor has TypeScript support available. We’ve been talking about type-checking, but we haven’t yet used our type-checker. Let’s get acquainted with our new friend tsc, the TypeScript compiler.
🌐
Medium
medium.com › @seanbridger › typescript-basics-1-10-typescript-compiler-tsc-and-tsconfig-f9bf0134c5eb
TypeScript Basics (1/10): TypeScript Compiler(tsc) and tsconfig | by Likely Coder | Medium
November 24, 2023 - It takes TypeScript code (.ts or .tsx files) and compiles it into JavaScript code (.js files) that can be executed by a JavaScript runtime. ... After installing tsc, you can compile TypeScript files by running the following command in your terminal:
🌐
Visual Studio Code
code.visualstudio.com › docs › typescript › typescript-compiling
Compiling TypeScript
November 3, 2021 - You can also define the TypeScript build task as the default build task so that it is executed directly when triggering Run Build Task (⇧⌘B (Windows, Linux Ctrl+Shift+B)). To do so, select Configure Default Build Task from the global Terminal menu. This shows you a picker with the available build tasks. Select TypeScript tsc: build, which generates the following tasks.json file in a .vscode folder:
🌐
Simon Willison
til.simonwillison.net › typescript › basic-tsc
Very basic tsc usage | Simon Willison’s TILs
VSCode has built-in TypeScript support. Hit Shift+Command+B and select the tsc: watch option and it runs that watch command in a embedded terminal pane inside the editor itself.
🌐
TypeScript
typescriptlang.org › download
TypeScript: How to set up TypeScript
You can use npm to install TypeScript globally, this means that you can use the tsc command anywhere in your terminal.
🌐
Reddit
reddit.com › r/typescript › do you use tsc in a production environment? seems like everyone uses a third-party transpiler.
r/typescript on Reddit: Do you use tsc in a production environment? Seems like everyone uses a third-party transpiler.
May 13, 2024 -

I'm wondering what the use-cases are for tsc as a transpiler, since it seems like almost everyone uses a third-party one. I'd prefer to use tsc instead of relying on an additional dependency, but find it too restrictive. This has me wondering: who does use it?

To be clear: I understand the use-case for tsc as a type-checker, just not as a transpiler.

Edit: I should have specified: this question is about transpiling with tsc for front-end code, not back-end code.

Find elsewhere
🌐
Medium
medium.com › @leroyleowdev › understanding-the-typescript-compiler-and-its-options-63bbc3c494ab
Understanding the TypeScript Compiler and Its Options | by Leroy Leow | Medium
January 18, 2025 - The TypeScript compiler, often referred to as tsc, is responsible for compiling TypeScript code into JavaScript. It takes TypeScript source…
🌐
daily.dev
daily.dev › home › blog › get into tech › npm tsc and typescript projects
Npm tsc and TypeScript Projects
February 4, 2025 - TypeScript transforms your code into JavaScript that browsers can understand. npm tsc is a tool that compiles TypeScript (.ts) files into JavaScript (.js) files.
🌐
Node.js
nodejs.org › en › learn › typescript › transpile
Node.js — Running TypeScript code using transpilation
NOTE: npx is a tool that allows you to run Node.js packages without installing them globally. tsc is the TypeScript compiler which will take our TypeScript code and compile it to JavaScript.
🌐
egghead.io
egghead.io › lessons › typescript-understand-the-typescript-compiler-aka-tsc
Understand the TypeScript Compiler AKA tsc | egghead.io
The TypeScript Compiler (also known as "tsc") is the backbone of many bundlers, plugins, and tools that work with TypeScript. While we don't often invoke tsc directly, we do configure how tsc behaves inside of the bundlers that we use.
Published   December 5, 2018
🌐
npm
npmjs.com › package › tsc
tsc - npm
A deprecated release of the TypeScript compiler. Latest version: 2.0.4, last published: 4 years ago. Start using tsc in your project by running `npm i tsc`. There are 775 other projects in the npm registry using tsc.
      » npm install tsc
    
Published   Jan 15, 2022
Version   2.0.4
🌐
Learn TypeScript
learntypescript.dev › 11 › l1-installing-running-compiler
Installing and running the compiler | Learn TypeScript
This command first downloads and installs the typescript npm package. tsc is the executable name of the TypeScript compiler.
🌐
Tutorial Teacher
tutorialsteacher.com › typescript › typescript-compiling-project-and-tsconfig
Compile TypeScript Project
As you know, TypeScript files can be compiled using the tsc <file name>.ts command. It will be tedious to compile multiple .ts files in a large project.
🌐
E-zest
blog.e-zest.com › what-are-compiler-options-in-typescript
What are Compiler Options in TypeScript?
In TypeScript, whenever we compile our code of file type .ts it gets converted into a .js file by using tsc compiler. It means that the TypeScript code get trans-compiled into plain JavaScript. The figure below shows how the compilation process ...
🌐
Parcel
parceljs.org › languages › typescript
TypeScript
TSC is the official TypeScript compiler from Microsoft. While Parcel’s default transpiler for TypeScript is much faster than TSC, you may need to use TSC if you are using some configuration in tsconfig.json that Parcel doesn't support.
🌐
Fig
fig.io › manual › tsc
tsc <tsc script>
tsc · CLI tool for TypeScript compiler · On this page · Arguments · Options ·
🌐
Vskills
vskills.in › home › typescript tsc
TypeScript tsc - Tutorial
April 12, 2024 - Learn TypeScript tsc: using TypeScript compiler tutorial TypeScript files are compiled into JavaScript. Click here.