Not getting output while trying db.find() in Mongodb

Recently i have started learning mongodb and started to make a simple application that will just display the data present in my database. Here’s the code: var mongoose = require(“mongoose”); …

Making a signup form and login form using express server

So I am basically making a simple website on my localhost that has a signup form and some other html elements. I managed to setup the signup process smoothly. So when the user fills in the form and …

Getting TypeError: Cannot read property ‘name’ of undefined, while posting the form – node.js

I am building a node Js project and i am saving the values of form to a mongoDB database. Despite of trying i couldn’t find what is causing this error. Error is at router.post function on 3rd line. …

Can’t Push data One to Many Relation (nodejs ,mongodb)

I am trying to insert data into MongoDB database but I get this error Cannot read property ‘push’ of undefined. I can’t understand what is the issue is here in my code. please help me with the …

Cast to ObjectID failed – mongoose

Hi I am trying to add an event to a users profile once they click on the event. I am getting the following error – Cast to ObjectId failed for value “{ event: ‘600066640807165d042b91dd’ }” …

How to automate the creation of multiple ejs files with nodejs

I am currently making a blog site and I have this “compose page” where I can write articles. I’m currently using ejs so when the article is posted the data gets saved. But these articles are …

Language getting detected but translation not working with i18n

I have set up the i18n middleware in my Express Node js server like this: // server.js import i18nMiddleware from ‘i18next-express-middleware’; import i18n from ‘i18next’; import Backend from ‘i18next-…

Express Sharp install via Docker issue

I need to use sharp. Its work fine on my workspace but if I deploymeny via docker then I get error. I am implementation all steps. Error: ‘linux-x64’ binaries cannot be used on the ‘linuxmusl-x64’ …

Cannot read property ‘path’ of undefined while uploading image upload on the frontend(react)

I am trying to upload an image on the frontend, but this is not working, I am getting the error below message: “Cannot read property ‘path’ of undefined” status: “fail” When I log …

multer npm: TypeError: Cannot read property ‘path’ of undefined

I have a problem uploading an image file to my server, I watched a tutorial on YouTube about multer and I do exactly the same thing that is done in the tutorial and for whatever reason I get an error: …