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



Solution 1:[1]

I had installed the old typescript compiler https://www.npmjs.com/package/tsc by mistake.

running where.exe tsc to find out what I was actually running suggested by @siddharth made me find the issue

Solution 2:[2]

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


The fix is:

npm uninstall tsc

Solution 3:[3]

There is nothing to do as it's a very easy problem. Go to your vs code folder where you have installed node package. For example, in my system, it is:

C:\Users\vivek\AppData\Roaming\npm

First of all you will notice that both the tscServer and tsc files are not created. So first delete all the tsc files, then go to the vs code and uninstall typeScript like this:

npm uninstall typescript

Then again install the typescript like this:

npm install -g typescript

Solution 4:[4]

On my Mac, this fixed it:

npm uninstall -g typescript
npm install -g typescript

When I was fooling around trying to get started, i had done something like this:

npm install -g tsc   #bad, don't do this

which had screwed up my install.

Solution 5:[5]

The tsc module is DEPRECATED! You only need the typescript module, if you need tsc!!!

s. https://www.npmjs.com/package/tsc

Solution 6:[6]

Try chocolatey manager for typescript installation https://community.chocolatey.org/packages/typescript

choco install typescript

Solution 7:[7]

If using Volta or similar version managers you can do

npm remove -g typescript tic
pnpm remove -g typescript (if using pnpm)

and install it again with your node package manager of choice (globally)!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Björn Hjorth
Solution 2 Etienne Kaiser
Solution 3 ouflak
Solution 4 Vineel Shah
Solution 5 Gerd
Solution 6 Prashen
Solution 7 Alvaro Aquije