Answers for "tsc : The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or"

1

tsc types.ts 'tsc' is not recognized as an internal or external command, operable program or batch file.

1. Install as global package

To make TypeScript compiler available to all directories for this user, run the below command:

npm install -g typescript
You will see something similar to

C:UsersusernameAppDataRoamingnpmtsserver -> C:UsersusernameAppDataRoamingnpmnode_modulestypescriptbintsserver C:UsersusernameAppDataRoamingnpmtsc -> C:UsersusernameAppDataRoamingnpmnode_modulestypescriptbintsc + [email protected] added 1 package from 1 contributor in 4.769s

2. Set the environment variable

Add the npm installation folder to your "user variables" AND "environment variables".

In windows you can add environment variable PATH with value

C:UsersusernameAppDataRoamingnpm

i.e. wherever the npm installation folder is present.

Note: If multiple Paths are present separate them with a ;(semicolon)

If the below command gives the version then you have successfully installed

tsc --version
Posted by: Guest on January-19-2021
0

The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.

//Install globally
npm i -g typescript
//or locally for a project
npm i typescript
Posted by: Guest on June-16-2021

Code answers related to "tsc : The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or"

Browse Popular Code Answers by Language