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

170
Vistas
importing fs in nodejs

hello everyone!

I'm trying to import fs module in nodejs

first I was using require to import it like this

const fs = require('fs');

It was working fine for a while but suddenly stopped working and I'm getting this Error now

Error: Uncaught ReferenceError: require is not defined

so I tried using Import to import it like this

import fs from 'node:fs'

and I tried many other ways for importing it using import and I'm getting this two Errors

Error1: GET node:fs net::ERR_UNKNOWN_URL_SCHEME

Error2: Uncaught TypeError: Failed to resolve module specifier "fs". Relative references must start with either "/", "./", or "../".

Is there any other ways for importing module in Nodejs? or the problem is my code? I've had many problems with fs module in nodejs, I've tried googling and I couldn't find any solution for this one, I appreciate you guys helping me.

I'm using it to load a local file in Electronjs

Thanks.

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