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

181
Views
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
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!