how to run typescript compiler from the commandline

Topics: General
Oct 2, 2012 at 7:13 PM

I would like to execute the TypeScript compiler on one of my javascript file I tried this using cscript


C:\TypeScript\bin>cscript //E:jscript tsc.js
c:\JS.JSMicrosoft (R) Windows Script Host Version 5.8Copyright (C) Microsoft Corporation. All rights reserved.
C:/bin/lib.d.tsC:/JS.JS.tsC:/JS.JS.strC:/JS.JS.d.strC:/JS.JS.d.tsError reading file "c:\JS.JS": File not found

Oct 2, 2012 at 7:27 PM

How did you install TypeScript?

If you have used the NodeJS package, you can simply type tsc in the command line.

Oct 2, 2012 at 7:29 PM

I just download the source code and run the file bin\tsc.js.

I can install the npm package , that said is it possible to not depend on the package.



Oct 2, 2012 at 8:46 PM

I installed TypeScript npm package, find the tsc.cmd file, but I still have the same error

Volume in drive C is Windows7_OS Volume Serial Number is 2C6A-70B3
Directory of C:\Users\frederic.torres\AppData\Roaming\npm
10/02/2012  02:56 PM    <DIR>          .
10/02/2012  02:56 PM    <DIR>          ..
10/02/2012  02:56 PM    <DIR>          node_modules
10/02/2012  02:56 PM               296 tsc
10/02/2012  02:56 PM               205 tsc.cmd               
                     2 File(s)            501 bytes               3 Dir(s)  20,170,735,616 bytes free

C:\Users\frederic.torres\AppData\Roaming\npm>tsc c:\JS.JS
Error reading file "c:\JS.JS": File not found


Oct 4, 2012 at 1:41 AM

You appear to be trying to compile JavaScript files (.js extension) with TypeScript.  JavaScript is the output, not the input.  Try compiling TypeScript files, and if you still hit issues, please raise them on the "Issue Tracker" section of this project.  Thanks!