Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

236
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda