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 › compiler-options.html
TypeScript: Documentation - tsc CLI Options
Running tsc locally will compile the closest project defined by a tsconfig.json, or you can compile a set of TypeScript files by passing in a glob of files you want. When input files are specified on the command line, tsconfig.json files are ignored.
🌐
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 - You can create a tsconfig.json file manually in the root of your project or use the tsc --init command to generate a basic configuration file.
🌐
Visual Studio Code
code.visualstudio.com › docs › typescript › typescript-compiling
Compiling TypeScript
November 3, 2021 - If you selected tsc: watch, the TypeScript compiler watches for changes to your TypeScript files and runs the transpiler on each change. Under the covers, we run the TypeScript compiler as a task. The command we use is: tsc -p .
🌐
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.
🌐
Jonlabelle
jonlabelle.com › snippets › view › shell › tsc-command
tsc command
# To compile a TypeScript file 'foobar.ts' into a JavaScript file 'foobar.js': tsc <foobar.ts> # To compile a TypeScript file into JavaScript using a specific target syntax (default is 'ES3'): tsc --target <ES5|ES2015|ES2016|ES2017|ES2018|ESNEXT> <foobar.ts> # To compile a TypeScript file into a JavaScript file with a custom name: tsc --outFile <output.js> <input.ts> # To compile all '.ts' files of a TypeScript project defined in a 'tsconfig.json' file: tsc --build <tsconfig.json> # To run the compiler using command line options and arguments fetched from a text file: tsc @<args.txt> # To type-check multiple JavaScript files, and output only the errors: tsc --allowJs --checkJs --noEmit <src/**/*.js>
🌐
daily.dev
daily.dev › home › blog › get into tech › npm tsc essentials for developers
NPM TSC Essentials for Developers
February 4, 2025 - Or, you can open your terminal, go to your project's folder, and type tsc --init. This command asks tsc to make a basic tsconfig.json file for you.
🌐
Medium
medium.com › jspoint › typescript-compiler-flags-3b1efebedf15
A brief introduction to TypeScript’s command-line interface and compiler settings | by Uday Hiwarale | JsPoint | Medium
September 1, 2020 - The tsc command envokes the TypeScript compiler. When no command-line options are present, this command looks for the tsconfig.json file.
Find elsewhere
🌐
Node.js
nodejs.org › en › learn › typescript › transpile
Node.js — Running TypeScript code using transpilation
tsc is the TypeScript compiler which will take our TypeScript code and compile it to JavaScript. This command will result in a new file named example.js that we can run using Node.js.
🌐
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.
🌐
DigitalOcean
digitalocean.com › community › tutorials › typescript-new-project
How To Set Up a New TypeScript Project | DigitalOcean
October 8, 2025 - npm init -y && npm i -D typescript ts-node eslint prettier @types/node && npx tsc --init · This command will initialize a new TypeScript project, install TypeScript and supporting developer tools, and generate a tsconfig.json file.
🌐
Linux Command Library
linuxcommandlibrary.com › man › tsc
tsc man | Linux Command Library
The primary purpose of tsc is to perform type-checking on TypeScript code, identify potential errors during development, and then emit runnable JavaScript code that can be executed in any JavaScript runtime environment (like browsers or Node.js).
🌐
Reddit
reddit.com › r/typescript › is there a way to run tsc to do type-checking only for a single file?
r/typescript on Reddit: Is there a way to run TSC to do type-checking only for a single file?
February 25, 2022 -

To be clear, I still want to use my tsconfig.json configuration while I do this.

My reasoning is I started using Vite recently, and I've been blown away by its speed. Obviously one of the downsides of Vite is that it compiles TS code without type checking, so you need to run the type checking after the fact (tsc --noEmit).

My goal is to use TSC for type checking in a similar way to eslint. There is an excellent NPM package, lint-staged, which automatically passes in a comma-separated list of files that have changed to the eslint command. This allows for much more efficient linting of only changing files as a pre-commit hook.

My hope is to find some way to use the CLI options for TSC (or another tool, if one exists) that can perform this same functionality. That way I can enforce all my type-checking as a pre-commit hook and streamline my new Vite workflow.

Thanks so much in advance.

🌐
TypeScript Tutorial
typescripttutorial.net › home › typescript tutorial › typescript setup
TypeScript Setup
October 18, 2024 - Use the tsc command to compile a TypeScript file to a JavaScript file.
Top answer
1 of 4
33

You should not add TypeScript's bin folder directly to the Windows PATH. As you noticed, the files in that bin folder are not directly executable from the command line.

Instead, npm creates a .cmd script for every configured executable in a globally installed package and puts it in:

%APPDATA%\npm

Try updating your PATH to include this folder, re-open your command line and try running tsc again.

Side note: the Node.js installer for Windows by default adds Node and NPM to your Windows path. If you have installed Node.js normally, this should have worked just fine. Anything special about how you have your Node set up?

2 of 4
3

I'll share a couple of gotchas (that got me!) when I installed typescript (I followed https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html) on windows 10. I had earlier setup node by following the instructions at https://github.com/coreybutler/nvm-windows after failing miserably with other approaches.

Gotcha #1 - Both tsc and tsc.cmd are on the path (at %NVM_SYMLINK%) but tsc is the bash script. In other words you have to use the command tsc.cmd in order to actually invoke the windows version! Just invoking tsc will (in my Powershell terminal) cause it to fall over with weird errors.

Gotcha #2 - Windows file system locking semantics strikes again! Because I had been digging into the problem, I had the tsc.cmd file open in an editor - which was locking the file! This causes the correct invocation (tsc.cmd) to also fail.. till I closed the editor.

Hope this helps someone..

🌐
Render
community.render.com › t › typescript-this-is-not-the-tsc-command-you-are-looking-for › 20334
Typescript: This is not the tsc command you are looking for - Render
March 28, 2024 - During the deployment of my Express.js application with TypeScript on render.com, I encountered an error. Here’s the error log: ==> Using Node version 20.12.0 (default) Mar 28 05:05:24 PM==> Docs on specifying a Node version: https://render.com/docs/node-version Mar 28 05:05:25 PM==> Running build command 'npm i && npm run build'...
🌐
TypeScript
typescriptlang.org › docs › handbook › 2 › basic-types.html
TypeScript: Documentation - The Basics
You can use npx or similar tools if you’d prefer to run tsc from a local node_modules package instead. Now let’s move to an empty folder and try writing our first TypeScript program: hello.ts: ... Notice there are no frills here; this “hello world” program looks identical to what you’d write for a “hello world” program in JavaScript. And now let’s type-check it by running the command tsc which was installed for us by the typescript package.