Cannot find module 'fs/promises' Electron JS
I experienced this issue a few days ago as well. I realized that trying to fix another issue, I deleted the node_modules
folder and the package-lock.json
file, then run the npm install
command. This made the build to fail with 'fs/promises'. There are 2 solutions to this issue:
- Download the latest stable Node version. This should have the 'fs/promises' module and will fix the issue.
- Delete the
node_modules
folder and bring back the oldpackage-lock.json
file to ensure that the package versions remain the same. Then run thenpm install
command and the issue should be fixed.
downgrade electron"electron-builder": "^22.10.5",or upgrade nodejs to 14+ v
downgrade to "electron-builder": "~22.10.5"
is working for me