Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

314
Views
Cannot find module 'fs/promises' Electron JS

Good morning,

I have created a program in Vue JS, this connects with an API that I have created in a main.js file to execute system commands.

The problem I have is that when compiling for production with electron I get the following error:

ERROR

I use the command npm run electron: build

When I use npm run electron:serve work without problems

Anyone have any idea why is the error and how to fix it? Thanks

over 4 years ago · Santiago Trujillo
5 answers
Answer question

0

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:

  1. Download the latest stable Node version. This should have the 'fs/promises' module and will fix the issue.
  2. Delete the node_modules folder and bring back the old package-lock.json file to ensure that the package versions remain the same. Then run the npm install command and the issue should be fixed.
over 4 years ago · Santiago Trujillo Report

0

downgrade to "electron-builder": "~22.10.5" is working for me

over 4 years ago · Santiago Trujillo Report

0

downgrade electron "electron-builder": "^22.10.5", or upgrade nodejs to 14+ v

over 4 years ago · Santiago Trujillo Report

0

In my case I was using nvm to manage multiple node versions.

During the npm package installation, and throughout development, I used Node v14 but for some reason, my terminal was pointing to Node v12 when I tried bundling my program afterwards.

Switching it back to Node v14 using nvm use 14 solved my issue.

So make sure you're using the correct node version.

over 4 years ago · Santiago Trujillo Report

0

In that case i fix the problem in that way: const fs = require('fs').promises;

instead of: const fs = require('fs/promises');

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!