0

I am using VS code for Angular 2 application. After coding my ts files when I try to compile to JS it doesn't happen. The JS file is not getting created. I get no errors on Ctrl+Shift+B. What could be causing this?

PS: I have done the configuration in tasks.json and launch.json already.

If I run npm start on CMD prompt it works fine though.

This is my tasks.json:

{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "tsc",
"isShellCommand": true,
"args": [],
"showOutput": "silent",
"problemMatcher": "$tsc"
}
Peter
  • 10,492
  • 21
  • 82
  • 132

1 Answers1

0

I ran the "tsc" command on the command prompt to find out that it gives an error. "tsc is not recognized as internal or external command". The issue was because the path to tsc was not set in environment variables. So I added a new environment variable in advanced system settings:

NAME : "PATH"
VALUE: "C:\Users\{{your_account}}\AppData\Roaming\npm".

And it worked fine.

Peter
  • 10,492
  • 21
  • 82
  • 132