'I am not able to upload image on the cloudinary using mern stack

Here is the source code github of my current project which i am working i belive i might doing something very stupid i cant figure whats that The main issue in my life is i am getting the image in my backend but while uploading my server just crash Here is my function registerUser Whose Purpose to life is get data and put it in database and upload image on the cloudinary as you can see i am consoling log name and avatar which proves i am getting data in my function perfectly the line const myCloud = await cloudinary.v2.uploader.upload(req.body.avatar, { folder: "avatars", width: 150, crop: "scale", }); is crashing server

exports.registerUser = catchAsyncErrors( async(req,res,next)=>{
  console.log("The file is ",req.body.name);
  console.log("The cloudinary function is ",req.body.avatar);
  const myCloud = await cloudinary.v2.uploader.upload(req.body.avatar, {
    folder: "avatars",
    width: 150,
    crop: "scale",
  });
    console.log("The value of my cloud is",myCloud)
    const {name,email,password} = req.body;
    
    const user = await User.create({
        name,email,password,
        avatar:{
            public_id:myCloud.public_id,
            url:myCloud.secure_url,
            // public_id:"This is the public id",
            // url:"THis is url",
        }
    });


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source