Donate

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

Good Day Gents!

During this free-time I started setting up Node.js on my machine as part of my career goals which is learning new frameworks in preparation for new projects. So the first thing I did was to install TypeScript language to get myself familiar with Angular 2+. After I finished setting up TypeScript, I then created a simple HelloWorld program and ran the application through Visual Studio Code using the "tsc: build - tsconfig.json" command. I encountered an error which says "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 if a path was included, verify that the path is correct and try again."
Below are the details on my machine and packages installed:
  - Operating System: Windows 10 Pro
  - Node.js: 14.16.0
  - npm version: 6.14.11
  - Typescript: 4.2.3 (using command: "npm install -g typescript")

After doing some research and reading through the documentation, the following steps below solved the issue on why the tsc command is'nt recognized:
1. Add the npm folder in User variables of the Environment Variables - C:\Users\your_username\AppData\Roaming\npm
The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program
2. Add the npm folder in System variables of the Environment Variables - C:\Users\your_username\AppData\Roaming\npm
The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program
3. Restart your computer which is an important step for new software installations of Windows Operating System.

Cheers!

Comments

Post a Comment

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

Invalid nested tag div found, expected closing tag input