Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

462
Views
Having error, keeps saying Unknown File Extension
`"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.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

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:

    • Install ts-node using npm i ts-node.
    • Create a new Node.js run/debug configuration.
    • Add --require ts-node/register to the Node parameters field.
    • In the JavaScript file field add $FilePathRelativeToProjectRoot$.
    • Save configuration.
    • Use it to run (or debug) a file that is currently opened in the editor or selected in the Project view. You can do that using the icons on the navigation bar or Run... action.

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

    • Create a Node.js run/debug configuration.
    • In the Before Launch section, click Add and select Compile TypeScript.
      • Select tsconfig.json.
      • In the JavaScript file field you need to select the path to the compiled .js file.
      • If a compiled JavaScript lives next to its source, add $FileRelativeDir$/$FileNameWithoutExtension$.js
      • If files are saved in an output folder (preserving the folder structure), add the folder name before the pattern, e.g. build/$FileRelativeDir$/$FileNameWithoutExtension$.js
      • Save configuration.
      • Use it to run (or debug) a file that is currently opened in the editor or selected in the Project view.
about 4 years ago · Juan Pablo Isaza Report

0

I 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"
  },
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!