Im trying to use native import which were released with node 12 but i always get this error even with importing just cors
import * as cors from 'cors';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Module._compile (internal/modules/cjs/loader.js:892:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loacjsder.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
at internal/main/run_main_module.js:17:11
node version v12.13.0
docs https://nodejs.org/docs/latest-v12.x/api/esm.html#esm_code_import_code_specifiers which i tried to follow.
Thanks for help