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

168
Views
How do I create npm module for local files on my PC?

In my javascript code I am accessing .json file from the same local folder.

const data = require('../JS/countries.json');

When I published it on a GitHub I realized that no one, except for me can't run the program. The error says:

 code: 'MODULE_NOT_FOUND',
 requireStack: [ '/home/me/progs/testGit/technical-question/main.js' ]

From the internet I understood that I need to create a node module for passing this .json file.

Can anyone help me? I was reading articles on that topic, but I don't think I understood much.

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!