To fix the cannot find module ‘fs/promises’ error in Node.js, upgrade or download the latest stable Node version. This should have the ‘fs/promises’ module, which will resolve the issue.
The main reason for the error is when using a Node.js version below 14.0. This means the module ‘fs/promises’ is not included in Node.js by default in previous versions.
Visual representation of error and solution
To check your Node.js version, run this command: node -v
You can see that I am already using the latest version of Node.js. If you are using an older version, consider upgrading.
I hope this will help you!