I have hw.ts
file with this content:
function greeter(x: string) {
return "Hello" + x;
}
let u = "John";
document.body.innerHTML = greeter(u);
I select Start without debugging
and VSCode says:
Cannot launch program 'hw.ts' because corresponding JavaScript cannot be found.
OK so I compile file from the commandline:
tsc hw.ts
Now I do have hw.js
in the same folder.
So again I select Start without debugging
and VSCode again says Cannot launch program 'hw.ts' because corresponding JavaScript cannot be found.
.
Is there any way to compile & run TypeScript program from VSCode? What am I missing?
(I do have node
in my PATH
, it should be visible to VSCode)
It worked for me as soon as I changed
"outFiles": [
"./dist/**/*.js"
],
to
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With