Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

233
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda