Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

168
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda