Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

where is the mistake for this error? Error: Cannot find module ' . / middleware / errorHandler ' Require stack: - C: Users

where is the mistake for this error? Error: Cannot find module './middleware/errorHandler'
Require stack:
- C:\Users\pauli_2wm671y\p.habbecke-us-states\server.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
at Module._load (node:internal/modules/cjs/loader:984:27)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at require (node:internal/modules/helpers:179:18)
at Object. (C:\Users\pauli_2wm671y\p.habbecke-us-states\server.js:21:22)
at Module._compile (node:internal/modules/cjs/loader:1369:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Module._load (node:internal/modules/cjs/loader:1022:12)
at Function.executeUserEntryPoint [as runMain](node:internal/modules/run_main:135:12){
code: 'MODULE_NOT_FOUND',
requireStack: ['C:\\Users\\pauli_2wm671y\\p.habbecke-us-states\\server.js']
}
Node.js v20.12.2
[nodemon] app crashed - waiting for file changes before starting...below middleware/errorHandler code // IMPORT SECTION
const { logEvents }= require("./logEvents");
// ERROR HANDLER SECTION
const errorHandler =(err, req, res, next)=>{
logEvents(`${err.name}: ${err.message}`, "errorLog.txt");
console.error(err.stack);
res.status(500).send(err.message);
};
// EXPORT SECTION
module.exports = errorHandler;

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle9i Database Administrator Implementation And Administration

Authors: Carol McCullough-Dieter

1st Edition

0619159006, 978-0619159009

More Books

Students also viewed these Databases questions

Question

Create an argument for Freuds greatest legacy ?

Answered: 1 week ago

Question

3. Identify cultural universals in nonverbal communication.

Answered: 1 week ago

Question

2. Discuss the types of messages that are communicated nonverbally.

Answered: 1 week ago