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

182
Vistas
mecanografiado "Error de referencia no capturado: el requisito no está definido"

chicos, tengo preguntas. ¿Cómo obtengo nombres de archivo de una carpeta usando mecanografiado? Intento de la siguiente manera:

  1. Creo una carpeta y escribo la línea de comando "tsc --init" y creo "tsconfig.json" donde cambie las opciones: "módulo": "es2015" y "objetivo": "es6".
  2. Creo "" en código html.
  3. Creo el archivo app.ts y escribo el código:
 import * as fs from 'fs'; class HTML_Element { public html_element: HTMLElement; constructor(html_string: string) { this.html_element = new HTMLElement(); this.html_element.className = "gallery_item"; this.html_element.innerHTML = html_string; } }

const html_div: HTML_Element = nuevo HTML_Element("FSDfdsfsd");

const list_image: cualquiera = fs.readdirSync('../imagen/')

consola.log(imagen_de_lista)

4.Escribo el comando en la terminal "tsc app.ts" y obtengo "app.js"

 "use strict"; exports.__esModule = true; var fs = require("fs"); var HTML_Element = /** @class */ (function () { function HTML_Element(html_string) { this.html_element = new HTMLElement(); this.html_element.className = "gallery_item"; this.html_element.innerHTML = html_string; } return HTML_Element; }()); var html_div = new HTML_Element("<div>FSDfdsfsd</div>"); var list_image = fs.readdirSync('../image/'); console.log(list_image);

5. Recibo un error en el navegador: Error de referencia no detectada: la solicitud no está definida

about 4 years ago · Juan Pablo Isaza
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