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

486
Views
Trying Repo Github repository, but error showing Error: ENOENT: no such file or directory

https://github.com/Akshitaag/ACM-WH I repo this in vs code and tried running it as shown The project started on server but showing error while trying to use register Error: ENOENT: no such file or directory, stat '/Users/rajivjain/Desktop/ACM-WH/C:/Users/hp/ACM-WH/public/register.html'

Help me solve this

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Found the issue. If you check the "routes" directory, then take a look at where the register route is taking you, its file path is linked as this:

router.get("/register",function(req,res){
    //res.sendFile("/home/rahmeen/Desktop/ACM-WH/public/register.html");
    res.sendFile("C:/Users/hp/ACM-WH/public/register.html");
});

The issue with this is that it's linking to the route the file is in starting with the developer's C drive.

It seems like the developers have not yet discovered the proper usage of the path module, which is a module baked into Node; however, they are using it within the server.js.

Try replacing that entire route code referenced above with this:

const path = require('path');

router.get("/register",function(req,res){
    res.sendFile(path.join(__dirname + '/register.html'));
});

I'd also recommend cleaning up the file structure of this repo.

about 4 years ago · Juan Pablo Isaza Report
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!