Home > Net >  Typescript files to JS
Typescript files to JS

Time:07-30

I have project on express using typescript. When i try to use tsc to convert typescript files to js and create build folder, It's creating and everything is fine but when i try to start server in build folder am getting error SyntaxError: Cannot use import statement outside a module.

CodePudding user response:

please update more information about the steps that you did this. But have a guide to do typescript.

this StackOverflow: Typescript: Cannot use import statement outside a module

orr Blog: https://bobbyhadz.com/blog/typescript-cannot-use-import-statement-outside-module#:~:text=To solve the error "Cannot,run them directly with node .

  • Related