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
I do not have TypeScript installed globally to my knowledge so what I am expecting is that It can't find tsc
.
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!
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.
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.
What is tsc? A deprecated release of the TypeScript compiler.
The problem in my case was that I had installed tsc
package instead of the correct typescript.
The fix is:
npm
uninstall tsc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With