Typescript has a concept of external modules which is actually required when you are using node.js or require.js To compile an typescript application which has external modules you need to add --module flag like below :
tsc your_file_name.ts --module "commonjs"
If you are working on Visual Studio and getting this error then you need to specify the Module System as AMD under project settings. Go To Properties of the TypeScript Project and then change Module System as AMD as shown below.
You also have to set the Automatically compile Typescript files which are not part of a project to "Use amd code generation for modules that are not part of a project". To do that you need to go to Tools -> Options -> Text Editor -> TypeScript -> Project -> General and change like below.
Please Like and Share the Blog, if you find it interesting and helpful.