MongoDB issue please, help

Hello, Guys.

Who might be wondering to help me with MongoDB compass?
on an attempt to connect vidly-api-node with the MongoDB server I am watching a number of mistakes that do not allow me to launch it correctly.

Error: Cannot find module ‘joi’
Require stack:

  • /Users/Narkolog-Mac/vidly-api-node/models/genre.js
  • /Users/Narkolog-Mac/vidly-api-node/seed.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
    at Function.Module._load (node:internal/modules/cjs/loader:804:27)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object. (/Users/Narkolog-Mac/vidly-api-node/models/genre.js:1:13)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)
    at Object.Module._extensions…js (node:internal/modules/cjs/loader:1180:10)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1028:19) {
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [
    ‘/Users/Narkolog-Mac/vidly-api-node/models/genre.js’,
    ‘/Users/Narkolog-Mac/vidly-api-node/seed.js’
    ]
    }
    Narkolog-Mac@MacBook-Pro-Ivan vidly-api-node %
1 Like
  1. Make sure Joi is installed, check your packages.json on the dependency list
npm i joi
  1. at the top of your genre.js
const joi = require('joi');

I had the same issue and I tried to install joi but I still have a problem

I’m looking forward from anyone to help me regarding above issue. thanks.

try to double-check, the "joi " you define, and you write in somewhere (typo)

Hi, Thanks for your suggestion. I checked and everything seems fine. I reinstall the Jason file and still have the same error.

show me your genres code