1

(I work with Webstorm)

I am absolutely new at Angular so forgive me my ignorance. I started with a Udemy Angular course and I am at a part where they are talking about Typescript compiler, more specifically the tsc command. Well, I followed the instructions: I installed Typescript globally using the npm install -g typescript command.

C:\Users\Tijl Declerck\Desktop\projects\AngularTestApp>npm install -g typescript
C:\Users\Tijl Declerck\AppData\Roaming\npm\tsserver -> C:\Users\Tijl Declerck\AppData\Roaming\npm\node_modules\typescript\bin\tsserver
C:\Users\Tijl Declerck\AppData\Roaming\npm\tsc -> C:\Users\Tijl Declerck\AppData\Roaming\npm\node_modules\typescript\bin\tsc
+ typescript@2.6.1
updated 1 package in 123.052s

Then they asked me to create a folder ts-hello inside the Angular app and give it a file main.ts:

Main.ts

function log(message){
  console.log(message)
}

var message = "hello world";

log(message);

Ok, so now they wish me to transpile the TS file using tsc main.ts so that the folder ends up with two files main.js & main.ts. I however get this error message:

C:\Users\Tijl Declerck\Desktop\projects\AngularTestApp\ts-hello>tsc main.ts
"tsc" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

'tsc is not recognized as an  internal or external command, program or executable batch file'(more or less the correct translation, I don't know why my console is all of a sudden in Spanish :D)

I have absolutely no idea what to do at this point. I've seen similar questions and I've tried some of their solutions like trying to reset the command line or redo the installation of Typescript, but those didn't seem to work. Other replies were just way too technical so I had absolutely no clue what they meant.

Could someone help me figure out what might be wrong and explain to me in an understandable way (It's my very first day in Angular).

tilly
  • 2,229
  • 9
  • 34
  • 64
  • Follow this [**link**](https://www.npmjs.com/package/typescript-compiler) – Aravind Nov 04 '17 at 00:11
  • you may want to add node global modules to your path check https://stackoverflow.com/questions/9587665/nodejs-cannot-find-installed-module-on-windows this out – nikoss Nov 04 '17 at 00:19

1 Answers1

0

Run this command on your console.

npm install -g typescript

Vinny
  • 149
  • 1
  • 4
  • Thanks for the response, but I already tried this multiple times and it didn't change anything. Still tsc is not recognized. There's a problem with my path, but I'm too beginner to solve this myself. – tilly Nov 04 '17 at 10:55