Editing the typescript project created on VisualStudio in WebStorm responds to this error:
Error: (1, 1) TS1148: it is not possible to compile external modules unless the '-module' flag is provided.
the code is simple:
in the file Test.ts
class helloWorld{ } export = helloWorld;
Thanks in advance for your help.
EDITED
I forgot to mention that I used a MAC.
In addition, after entering the message, in my quest to find a solution, I try to compile web pages in VisualStudio Code for Mac, and I have the same problem that, understand that the problem is not in the IDE, but that I did not understand this.
At fedemp, answer this offer:
One uses the flag when compiling: tsc --module commonjs or --module amd.
So, I go to the Webstorm settings β Languages ββand framework β typescript and the option βCommand line options:β I added --module amd and did it!
javascript webstorm typescript
NFRiaCowboy
source share