Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

474
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda