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

237
Vistas
Node.JS can't find Module inside Folder

I made a folder. Then cloned code from GH into it. so it's a folder inside my folder. I run (node index.js) and it throws 'error, module not found. What can I do differently?

`josh@Joshs-MBP random % node index.js
node:internal/modules/cjs/loader:927
  throw err;
  ^

Error: Cannot find module '/Users/josh/Desktop/random/index.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}josh@Joshs-MBP random % `
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Problem -

Running node index.js throws a module not found error.

Solution -

You need to change directory one directory level deeper.

You are currently in

/Users/josh/Desktop/random/index.js

You said you created a directory, then put a Github repo inside of that directory. That means you need to change directory into the Github repo still.

If you look at the error it shows that you are running node index.js inside of a directory on your Desktop.

Based on your description of putting a Github repo inside of a directory you created, you likely need to use cd to move into it.

Solution -

  1. cd repoName

  2. ls to verify index.js is in the current location.

  3. When you see index.js in the output from ls type node index.js

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