Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

This is not the tsc command you are looking for

When I run tsc in the terminal (it does not matter where) I get returned:

This is not the tsc command you are looking for

enter image description here

I do not have TypeScript installed globally to my knowledge so what I am expecting is that It can't find tsc.

like image 731
Björn Hjorth Avatar asked May 24 '21 18:05

Björn Hjorth


People also ask

Why is tsc not working?

To solve the error "tsc: command not found", install the typescript package globally by running npm install typescript@latest -g or use the npx command with the --package flag, e.g. npx --package typescript tsc --init . The fastest way to solve the error is to use the npx command with the --package flag. Copied!

What is tsc command?

The tsc command envokes the TypeScript compiler. When no command-line options are present, this command looks for the tsconfig. json file. If no tsconfig. json is found, it returns by dumping the usage of tsc command.

How do I get tsc TypeScript?

TypeScript is available as a package on the npm registry available as "typescript" . You will need a copy of Node. js as an environment to run the package. Then you use a dependency manager like npm, yarn or pnpm to download TypeScript into your project.

Is tsc deprecated?

What is tsc? A deprecated release of the TypeScript compiler.


1 Answers

The problem in my case was that I had installed tsc package instead of the correct typescript.


The fix is:

npm uninstall tsc

like image 137
Kvn CF Avatar answered Sep 21 '22 15:09

Kvn CF