`"C:\Program Files\nodejs\node.exe" C:\Users\Keith\WebstormProjects\flashbot\src\index.ts
internal/process/esm_loader.js:74
internalBinding('errors').triggerUncaughtException(
^
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for C:\Users\Keith\WebstormProjects\flashbot\src\in
dex.ts
←[90m at Loader.defaultGetFormat [as _getFormat] (internal/modules/esm/get_format.js:71:15)←[39m
←[90m at Loader.getFormat (internal/modules/esm/loader.js:105:42)←[39m
←[90m at Loader.getModuleJob (internal/modules/esm/loader.js:243:31)←[39m
←[90m at async Loader.import (internal/modules/esm/loader.js:177:17)←[39m
←[90m at async Object.loadESM (internal/process/esm_loader.js:68:5)←[39m {
code: ←[32m'ERR_UNKNOWN_FILE_EXTENSION'←[39m
}
Process finished with exit code 1`
There is a lot of code and files for this project so I'm not sure what to tweak. It does, however, exist on github - https://github.com/flashbots/searcher-minter if you think you know the solution.
You can't run the Typescript code by passing it to Node.js directly, Node.js doesn't provide native support for executing Typescript. The code has to be either compiled on-the-fly or precompiled. here are some recipes:
To run a selected TypeScript file using ts-node:
npm i ts-node.--require ts-node/register to the Node parameters field.$FilePathRelativeToProjectRoot$.If you need to pass any additional parameters to ts-node (e.g. --project tsconfig.json), you can add them to the Application parameters field in the run/debug configuration.
To compile app with TypeScript and run a selected TypeScript file
tsconfig.json..js file.$FileRelativeDir$/$FileNameWithoutExtension$.jsbuild/$FileRelativeDir$/$FileNameWithoutExtension$.jsI think you should adjust your tsconfig.json file and add a new start script, I think maybe the global script you trying to run can't find the ts-node module
{
"compilerOptions": {
"target": "ES2018",
"module": "commonjs",
"lib": [
"es2018"
],
"declaration": true,
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": false,
"inlineSourceMap": true,
"inlineSources": true,
"experimentalDecorators": true,
"strictPropertyInitialization": false,
"typeRoots": [
"./node_modules/@types"
]
},
"exclude": [
"node_modules",
]
}
###Add new start in your package.json
"scripts": {
"start": "npx ts-node src/index.ts"
},