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

163
Vistas
import error when trying to import express-jwt

Here is the error I'm getting. Please help.

C:\Users\Val\Desktop\merncamp\server\middleware\index.js:1 import expressJwt from "express-jwt";

SyntaxError: The requested module 'file:///C:/Users/Val/Desktop/merncamp/server/node_modules/express-jwt/dist/index.js' does not provide an export named 'default' at Object. (C:\Users\Val\Desktop\merncamp\server\middleware\index.js:1) at Generator.next () at Object. (C:\Users\Val\Desktop\merncamp\server\routes\auth.js:1) at Generator.next () at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I don't know the exact context of what you are trying to do, I will however take a shot in the dark.

The error you are seeing implies that you are asking for something that doesn't exist, based on the way you are trying to import express-jwt.

When code modules in javascript are created they can have named exports and a default export.

From your error it looks like you are importing using the following statement

import expressJWT from 'express-jwt'

This is asking for the 'default' export from that module. Looking at the NPM page for the package it looks like expressJWT is a named export. If this is the case, you would need to modify your import statement to the following

import { expressJWT } from 'express-jwt'

I hope this helps. For next time, try adding your code that is causing the error to help others to answer.

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