Error: Cannot find module '/…/…Part-3/index.js' root@123: Why this Error

Issue

I am getting this Error, Actually,I just started with Express Js?

root@123:/.../...part-3# node index.js
internal/modules/cjs/loader.js:968
  throw err;
  ^

Error: Cannot find module '/.../...Part-3/index.js'
root@123:/.../...part-3#

Solution

This is because when you try to start the server outside the project directory using node. Therefore Start the server from your project directory.

Answered By – Alex Paul

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published