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

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