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

184
Visualizações
this is impossible to inculde fs library

here i want to use fs library at the js file to create and edit a json file. but whenever i include this namespace an strange error comes up. if i use

var fs = require("fs")

it throws the error:

Uncaught ReferenceError: require is not defined

if i use (in terms of any order)

import fs from "fs"

then it throws

Uncaught SyntaxError: import declarations may only appear at top level of a module

i even have tried using the require.js file but in that case it throws those errors:

Uncaught Error: Module name "fs" has not been loaded yet for context: _. Use require([])

now if i use require(["fs"]) it says:

Uncaught SyntaxError: expected expression, got '<'

and a few seconds later

Uncaught Error: Load timeout for modules: fs

i even have tried to create another js file in the separate folder and use the require in that too but it still doesn't work.

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