2
votes

When I tried using the import statement in webstorm with TypeScript enabled I get the error

Error:(14, 1) TS1148: Cannot compile external modules unless the '--module' flag is provided.

However if I add the --module flag to the TypeScript command line options under "webstorm Preferences -> Languages and Frameworks -> Typescript", I get the compiler cannot start error.

What's the best way to configure this?

1

1 Answers

4
votes

--module option requires module type (either '--module amd' or '--module commonjs')

Please see https://www.npmjs.com/package/typescript-compiler for more information about typescript compiler arguments