0

I am absolutely new at Angular so forgive me my ignorance. So, I got an error

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 tried to install typescript with npm install -g typescript but I still get this error when I try the code tsc main.ts. So I asked a person about this and they sent me to an answer in another stackoverflow post (Nodejs cannot find installed module on Windows?).

Add an environment variable called NODE_PATH and set it to %USERPROFILE%\Application Data\npm\node_modules (Windows XP), %AppData%\npm\node_modules (Windows 7/8/10), or wherever npm ends up installing the modules on your Windows flavor. To be done with it once and for all, add this as a System variable in the Advanced tab of the System Properties dialog (run control.exe sysdm.cpl,System,3).

However, this is only my second day using Angular and I have no idea how to do what he refers to. I think, however, that someone who is familiar with Angular knows how to fix this in a short time, I just have no idea where to add this new environment variable and how. I would proceed with my course, but they use the tsc command so often that it just leaves me very frustrated. Could someone please give me a step-by step explanation of the fix described above to solve this problem?

edit: I have windows 10 and work with webstorm.

tilly
  • 2,229
  • 9
  • 34
  • 64

1 Answers1

0

On how to manage your environment variables, aka $PATH, see here

You can also try call the it from your projects node_modules directory.

./node_modules/.bin/tsc main.ts // for windows
kangaro0
  • 185
  • 1
  • 11
  • Thanks, I appreciate the response. I tried it from the node_modules directory, but still same problem. I tried reading through that article, but it just gave me a headache. I don't understand why this has to be so difficult. In the course this takes two seconds to install typescript and use tsc and I'm already stuck on this shit problem for two days even though I followed the exact same steps – tilly Nov 04 '17 at 14:29
  • Okay, so i give you a shortcut: Win + Pause then on the left side: "Advanced System Settings" then in the new window on the bottom "Environment Variables" then just append your string to the path variable. – kangaro0 Nov 05 '17 at 12:53