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

184
Vistas
What is the correct way to use modules in Node.js?

Almost every tutorial I look at for Javascript uses require for accessing code from other files. When I run the code, however, I get this error:

ReferenceError: require is not defined in ES module scope, you can use import instead

So, I spend the next hour (at least) trying to figure out how to import the module properly. I am using Node v16.15.0. Should I be using a different version of Node? If not, why are all these tutorials using a different syntax? Is there a setting I should use that allows the use of require?

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