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

348
Views
require() de módulos ES no soportados
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: D:\...\node_modules\normalize-url\index.js [0] require() of ES modules is not supported. [0] require() of D:\...\node_modules\normalize-url\index.js from D:\...\routes\api\users.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. [0] Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from D:\Personnel\Linu x downloads n docs\Docs\Project 2\node_modules\normalize-url\package.json.

Traté de degradar el tipo de búsqueda de nodo: módulo, nada funcionó.

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

0

Instaló una nueva versión de normalize-url cuyo paquete.json contiene {tipo: módulo} esto se deduce de:

... paquete.json contiene "tipo": "módulo"

Debido a que los módulos se cargan usando 'importar' y no 'requerir', Node devuelve un error.


Cómo resolver

Probablemente necesite los scripts CJS.

Elimine y vuelva a instalar el paquete de la manera estándar ( npm remove normalize-url && npm i normalize-url ). Si npm i normalize-url@latest está instalado, entonces es un ES2015 y solo funciona con declaraciones de importación.

about 4 years ago · Juan Pablo Isaza Report

0

Bajó la versión del nodo a LTS y comenzó a funcionar.

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!