Search code examples
node.jsexpressnodemon

Cannot find module 'express' while running nodemon. Throw error, app crashed


I just created a project "project2" using "create new project : express --view=ejs project2" on a directory where I'd previously installed nodemon.

But when I typed "nodemon" on the terminal, the error says: enter image description here

I installed http-errors too, but the error message persists. What should I do to resolve this?


Solution

  • It worked after I installed express inside project2 using:

    npm install express --save
    

    However, there were still more error messages such as: "Could not find module 'cookie-parser'," which were all resolved by installing all the respective modules.