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.
Discussions

Is there a way to run TSC to do type-checking only for a single file?
By running tsc --help, you can see all of the help documentation for the tsc CLI. The second line of the help documentation says: tsc app.ts util.ts Ignoring tsconfig.json, compiles the specified files with default compiler options. There is also further information in TypeScript's online documentation for CLI Options . Note that this option ignores tsconfig.json. If that's not what you want, I also found a StackOverflow answer by searching "typescript run for specific files" on DuckDuckGo that seems to be your exact scenario. More on reddit.com
🌐 r/typescript
15
12
February 25, 2022
TSC is not recognized as the etc, etc etc... It worked yesterday but doesn't today? I don't understand.
A good way to execute TSC is with npx. If it's not in the node modules paths, it downloads and runs TSC. Btw, have you installed TSC with this line? npm install -g typescript Or with other way? More on reddit.com
🌐 r/typescript
37
1
April 26, 2019
pnpx tsc failed with "This is not the tsc command you are looking for"
pnpm version: 7.28.0 Code to reproduce the issue: $ pnpm add typescript -D Already up to date Progress: resolved 1, reused 1, downloaded 0, added 0, done Done in 251ms $ pnpx tsc .../Library/pnpm/s... More on github.com
🌐 github.com
5
March 1, 2023
Any Point to Using tsc Command when Making an Angular Project?
The angular cli will do everything for you. More on reddit.com
🌐 r/typescript
3
8
July 16, 2022
🌐
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.
🌐
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.
🌐
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.
Find elsewhere
🌐
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 .
🌐
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.
🌐
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.

🌐
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>
🌐
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.
🌐
GitHub
github.com › pnpm › pnpm › issues › 6159
pnpx tsc failed with "This is not the tsc command you are looking for" · Issue #6159 · pnpm/pnpm
March 1, 2023 - pnpm version: 7.28.0 Code to reproduce the issue: $ pnpm add typescript -D Already up to date Progress: resolved 1, reused 1, downloaded 0, added 0, done Done in 251ms $ pnpx tsc .../Library/pnpm/store/v3/tmp/dlx-43385 | +1 + .../Library...
Published   Mar 01, 2023
🌐
JSDev
jsdev.space › howto › tsc-not-found
How to Fix the tsc Command Not Found Error
The message “tsc: command not found” appears when the TypeScript compiler is not available in your system’s executable path.
🌐
npm
npmjs.com › package › typescript
typescript - npm
September 30, 2025 - TypeScript is a language for application scale JavaScript development. Latest version: 5.9.3, last published: 2 months ago. Start using typescript in your project by running `npm i typescript`. There are 61788 other projects in the npm registry using typescript.
      » npm install typescript
    
Published   Sep 30, 2025
Version   5.9.3
Author   Microsoft Corp.
🌐
DEV Community
dev.to › kovalevsky › getting-started-with-typescript-compiler-tsc-34h2
Getting Started With TypeScript Compiler (tsc) - DEV Community
January 30, 2022 - We will use tsc with a simple example. It is an command-line interface app that asks us to type our first name and username and then greetings us. It is a Node.js application and we will execute it by Node.
🌐
Vskills
vskills.in › home › typescript tsc
TypeScript tsc - Tutorial
April 12, 2024 - TS automatically compiles all files in a project directory and its sub-directories. It treats every directory with tsconfig.json file in the root as a project directory. When we run tsc on the command line, it searches for tsconfig.json starting ...
🌐
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.