• Register
0 votes
1.5k views

Problem :

I am new to type script and unable to compile my type script file.

When I try to hit Ctrl+Shift+B in my VS Code, I face below error

" ‘Tsc' is not recognized as an internal or external command, operable program or batch file."

I used the npm while downloading the transcript as below.

C:\Users\mphil>npm install -g typescript
C:\Users\mphil\AppData\Roaming\npm\tsserver -> C:\Users\mphil\AppData\Roaming\npm\node_modules\typescript\bin\tsserver
C:\Users\mphil\AppData\Roaming\npm\tsc -> C:\Users\mphil\AppData\Roaming\npm\node_modules\typescript\bin\tsc
C:\Users\mphil\AppData\Roaming\npm
`-- typescript@2.1.5
How to fix above error?
8 4 2
2,300 points

Please log in or register to answer this question.

1 Answer

0 votes
Solution :
 
I had the same issue and I was also unable to fix my issue. I researched on it a lot and found the below solution on it
1.I had installed the node.js version 8.1.3
2.After that I used the below command to install the npm 5.1.0
npm install npm#latest –g
3.After that I used the below command to install typescript 2.4.1
npm install -g typescript
4.After that I ran tsc --init in my directory. It created the tsconfig.json file in my directory where I was able to define my configuration. VSCode also started using the file once it found it in my root directory.
5.After that I could see my TS version, and was also able to compile the TS code.
Hope it helps you too.
 
5 2 1
4,980 points

Related questions

0 votes
1 answer 2K views
2K views
Problem : I am beginner in the node.js .Currently I am trying to install node.js using the below command npm install nodemon --save. But when I try to run a server with below command nodemon server.js. then in my terminal I face below error: “Nodemon is not recognized as internal or external command, operable program or batch file”
asked Feb 13, 2020 mphil 2.3k points
0 votes
1 answer 77 views
77 views
Problem : Facing following Node.Js error 'npm' is not recognized as an internal or external command, operable program or batch file.
asked Nov 18, 2019 peterlaw 6.9k points
0 votes
1 answer 6 views
6 views
Problem: node is not recognized as an internal or external command.
asked Feb 23 Ethan ross 1.8k points
0 votes
1 answer 23 views
23 views
Problem: I am very new to cordova, phonegap, ant,sdk,jdk. I am learning to use phonegap/cordova. Everything is installed properly on my machine i.e cordova, phonegap, ant,sdk,jdk. But now suddenly it started saying that: "’Node' is not recognized as an ... insufficient knowledge I am unable to fix this issue. I am looking for cordova and phonegap experts who can help me in fixing this issue.
asked Sep 2, 2020 Raphael Pacheco 4.9k points
0 votes
2 answers 561 views
561 views
Problem : I am new to Programming. I have created a Maven Project, the JavaScript project is cloned as the git sub-module inside Maven Project. My directory structure is as below mavenapp/src/main/javascript/[npm project files] and inside the package.json my test is looking as below : " ... install But it is not working for me.. npm version : 5.5.1 node version : 9.3.0 How can I fix above error?
asked Mar 3, 2020 mphil 2.3k points
0 votes
1 answer 7 views
7 views
Problem: 'ng' is not recognized as an internal or external command, operable program or batch file. What am i doing wrong?
asked 5 days ago Umar Ahmad 2.1k points
0 votes
1 answer 26 views
26 views
Problem: “rm' is not recognized as an internal or external command, operable program or batch file.
asked 6 days ago Muneeb Saadii 2.4k points
0 votes
1 answer 7 views
7 views
Problem: 'heroku' is not recognized as an internal or external command, operable program or batch file.
asked 6 days ago Muneeb Saadii 2.4k points
0 votes
1 answer 10 views
10 views
Problem: 'source' is not recognized as an internal or external command, operable program or batch file.
asked 6 days ago Muneeb Saadii 2.4k points
0 votes
1 answer 6 views
6 views
Problem: 'export' is not recognized as an internal or external command, operable program or batch file.
asked 6 days ago Muneeb Saadii 2.4k points