I am following this youtube video - https://www.youtube.com/watch?v=Rw_QeJLnCK4 , which step by step guides on how to upload an image to cloudinary.
this is the cloudinary config -
router.post('/create',auth,createBlog)
this is the route at which i am handling image upload
And here in the createBlog controller , i am importing that cloudinary config and doing the same as mentioned in the youtube video -
I am able to get the bas64encoded string of the image in the 'req.body.image' which i sent from frontend.
But the console.log(response) gives me this error -
TypeError: Cannot read property 'upload' of undefined
I have also created a preset named 'my_blogwebsite' in cloudinary associated with the folder of the same name.
I am using ES6 module for importing and exporting instead of commonJS in my express app.And in the video the instructor requires the cloudinary in commonJS like this -
const cloudinary = require("cloudinary").v2;
But i dont know how to add that '.v2' in ES6 module.I tried searching on google about this but had no luck.I think achieving this will solve my issue but i am not sure.
Edit - This is my folder structure
Please help me resolve this , thank you



cloudinary.uploader.uploadwithcloudinary.v2.uploader.upload?TypeError: Cannot read property 'uploader' of undefined./node_modules/cloudinary/cloudinary.js