TypeError: fs.createReadStream is not a function

I prefer to use promises rather than callbacks so I’ve used util.promisify. I’ve received TypeError: fs.createReadStream is not a function at const attachments = {attachment: fs.createReadStream(‘kitty.png’)}; lane. How can I solve that? Answer fs.promises is not a superset of fs. While it replaces some methods on fs with methods of the same core name that return a promise, it does not have everything on it that the plain fs has. createReadStream() is a method on the regular require(‘fs’) object, not on require(‘fs’).promises. This is why it is not recommended that you do this: Because then it misleads everyone, including yourself