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

178
Vistas
"The "path" argument must be string. Received undefined"how do I resolve this error

In my project that I developed with node js, I get the error "TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be string. Received undefined". Can you help me?

some of the codes:

router.post('/test', (req,res) =>{

   const post_image = req.files.post_image.name

   post_image.mv(path.resolve(__dirname, '../public/img/postimages', post_image.name))

   Post.create(req.body)
   console.log(req.files.post_image.name)
   res.redirect("/")
})

I think the error may be caused by the code in third line because when you make it a comment line, the error disappears.

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

0

_dirname or post_image.name must be undefined. Check all the arguments of path.resolve() function are defined and string

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