node.js - TypeScript: tsc.exe --execute: Error cannot find module -
i have following directory setup:
/app/ioc.ts /tests/test.ts
i'm in tests directory. contents of app/ioc.ts
unimportant, contents of tests/test.ts
are:
import ioc = module('../app/ioc'); var container = new ioc.container();
if compile so:
tsc test.ts
then run so:
node test
all's good! file runs without errors. however! if run this:
tsc -e test.ts
i following error:
module.js:340 throw err; ^ error: cannot find module '../app/ioc' @ function.module._resolvefilename (module.js:338:15) @ function.module._load (module.js:280:25) @ module.require (module.js:364:17) @ require (module.js:380:17) @ object.<anonymous> (d:/dropbox/work/sandbox/prototyping/typescript/tests/test.js:1:73) @ module._compile (module.js:456:26) @ object.run (c:\users\nathan\appdata\roaming\npm\node_modules\typescript\bin\tsc.js:56041:30) @ batchcompiler.run (c:\users\nathan\appdata\roaming\npm\node_modules\typescript\bin\tsc.js:56563:29) @ batchcompiler.batchcompile (c:\users\nathan\appdata\roaming\npm\node_modules\typescript\bin\tsc.js:56795:26) @ object.<anonymous> (c:\users\nathan\appdata\roaming\npm\node_modules\typescript\bin\tsc.js:56908:7)
any ideas?
your code fine. -e
flag being removed tsc, partly because doesn't play nicely sort of scenario. executing arbitrary js in context of compiler process turns out not idea.
Comments
Post a Comment