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

482
Visualizações
How to fix the error nodejs express cannot find module ./response

When I run the command

$ npm start

this shows up

> assignment3@1.0.0 start
> nodemon server.js

[nodemon] 2.0.12
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node server.js app.js`
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module './response'
Require stack:
- /Users/hoshidan/nodejsproject/assignment3/node_modules/express/lib/express.js
- /Users/hoshidan/nodejsproject/assignment3/node_modules/express/index.js
- /Users/hoshidan/nodejsproject/assignment3/app.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.<anonymous> (/Users/hoshidan/nodejsproject/assignment3/node_modules/express/lib/express.js:22:11)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/hoshidan/nodejsproject/assignment3/node_modules/express/lib/express.js',
    '/Users/hoshidan/nodejsproject/assignment3/node_modules/express/index.js',
    '/Users/hoshidan/nodejsproject/assignment3/app.js'
  ]
}
[nodemon] app crashed - waiting for file changes before starting...

I tried to search in node_modules/express/lib/express.js and saw that there's no file.

./response response.js

Don't know where to begin, would i just reinstall the node_modules or you have some thought of insights to fix this kind of error, hope you help me.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You should try reinstalling express:

rm -rf node_modules && npm i

This is so because it seems Express does have the response file over here: https://github.com/expressjs/express/blob/master/lib/response.js.

P.S.: Making a post since I can't comment.

about 4 years ago · Juan Pablo Isaza Relatório

0

reinstalling the express will eventually fix the problem.

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