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

230
Views
jsconfig.json Can't Work with "require" Node.js?

I'm studying the jsconfig.json file, the documentation doesn't mention explicitly whether it works with "import" and "require", or just "import".

This is the jsconfig.json I created (for Express project):

{
  "compilerOptions": {
    "baseUrl": "./",
    "module": "CommonJS",
    "target": "es2020",
    "paths": {
      "@/controllers/*": ["controllers/*"],
    }
  },
  "exclude": ["node_modules", "**/node_modules/*"]
}

I can't do like this:

const userController = require('@/controllers/user-controller');
// Error: Cannot find module '@/controllers/user-controller'

Why can't I use "require"? I Tried it in React and it worked with "import".

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!