0

I am convertng my NodeJs + ExpressJS project to Typescript, and I see this compiler error in the console. It does not even point at any specific code segment, which is why I don't know where to start diagnosing the problem. This project uses NodeJS + ExpressJS. I'm coding it in Webstorm and the Webstorm "FileWatcher" for Typescript automatically compiles the project.

C:/Users/Me/AppData/Roaming/npm/tsc.cmd --sourcemap Main.d.ts --out main.js --module

C:\Users\Me\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:55958
                    type = type.toLowerCase();
                                ^
TypeError: Cannot call method 'toLowerCase' of undefined
    at Object.opts.option.set (C:\Users\Me\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:55958:33)
    at OptionsParser.parse (C:\Users\Me\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:55506:36)
    at BatchCompiler.parseOptions (C:\Users\Me\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:56054:18)
    at BatchCompiler.batchCompile (C:\Users\Me\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:55576:22)
    at Object.<anonymous> (C:\Users\Me\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:56298:7)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
1

1 Answer 1

0

We have to specify a module if the module flag is set. Since it is a NodeJS project, module is "commonjs". The compiler command should be

tsc.cmd --sourcemap Main.d.ts --out main.js --module "commonjs"
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.