I am attempting to write some basic typescripts but I am encountering an issue with the setup below:
node src/getExchangeAndTickerList.ts
import * as mkdirp from 'mkdirp';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:1047:16)
at Module._compile (internal/modules/cjs/loader.js:1097:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
{
"compilerOptions": {
"module": "commonjs",
"target": "ES2018",
"moduleResolution": "node",
"baseUrl": ".",
"paths": {
"*": [ "./*" ],
},
"types": ["node"]
},
"include": [
"./src/**/*.ts",
],
"exclude": [
"./node_modules"
]
}