I appreciate that this is likely a naive question, however I am trying to find my way in the dark and the documentation from Microsoft really isn't as intuitive as I need it to be, since I've never worked with either Visual Studio Code or TypeScript before.
- I have installed Visual Studio Code (version 1.51.1)
Visual Studio Code > Help > About
references Node.js 12.14.1 - I'm not sure if it's telling me that it has included that in its own install or if it needs that to work properly- I have downloaded TypeScript for Visual Studio 2015 (from https://www.microsoft.com/en-us/download/details.aspx?id=48593) and successfully installed it by following the excellent and clear instructions from @Neurotransmitter
I have written and saved a basic .ts
file:
// my-first-typescript.ts
const myConst: number = 22;
console.log(myConst / 2);
If I now run Visual Studio Code > Terminal > New Terminal
and I enter:
tsc my-first-typescript.ts
a console pops up on Windows 7 asking:
Choose the program you want to use to open this file
Obviously the Terminal is trying to open tsc.js
and it doesn't know how.
This is where I'm stuck.
Is there any way to execute tsc.js
without having Node.js
installed? (I'm guessing not?)
But then, hasn't Visual Studio Code already installed itself with Node.js
? (If not, what's the Node.js 12.14.1 it refers to?)
I'm trying as much as possible to avoid downloading and installing Node.js
and npm
.
If I absolutely have to, then I will.
But it's a lot to download just to be able to run the TypeScript Compiler (tsc
) in Visual Studio Code.