Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio TypeScript error "Cannot compile modules unless the '--module' flag is provided."

When trying to compile and export a typescript module I get this error. I have read a few articles but none fix my problem, I am using VS2015 Exterprise, Thanks

like image 861
user971374 Avatar asked Oct 30 '22 19:10

user971374


1 Answers

Visual studio TypeScript error “Cannot compile modules unless the '--module' flag is provided.”

Right click the project and select "properties". Click on the TypeScript page in the project properties and then select your module (I personally recommend commonjs with webpack for frontend/browser or as is for nodejs)

like image 68
basarat Avatar answered Nov 12 '22 18:11

basarat