7

I'm trying to compile a sample script using the lib/tsc.js file in the 2.4.2 release of TypeScript.

At the Windows console I'm typing:

cscript lib\tsc.js test.ts

It gives the following error:

lib\tsc.js(216, 31) Microsoft JScript compilation error: Expected identifier

I had tried with the newest version of TypeScript on GitHub but it gave a similar error.

The sample script is:

function greeter(person: string) {
    return "Hello, " + person;
}

WScript.Echo(greeter("World"));

I'm pretty sure this used to work for an earlier version of TypeScript. Am I missing something?

Please assume I can't install Node or anything else.

2
  • 1
    WSH's JScript has been frozen since Windows XP was released, so I t does not support ECMAScript 5 features that TypeScript now depends on. You will have to restrict yourself to an older version of the JScript-based TSC that supports ES3. Commented Jul 29, 2017 at 11:48
  • 3
    @Dai Ah - thank you! For future readers - it looks like it needs to be the last version of the 1.* series, 1.8.10. Commented Jul 29, 2017 at 12:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.