添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'fs/promises' Require stack:

/Users/abhimatta/Documents/abhishek/accura-electron-dev/node_modules/builder-util/out/fs.js
/Users/abhimatta/Documents/abhishek/accura-electron-dev/node_modules/builder-util/out/util.js
/Users/abhimatta/Documents/abhishek/accura-electron-dev/node_modules/electron-builder/out/cli/cli.js
/Users/abhimatta/Documents/abhishek/accura-electron-dev/node_modules/electron-builder/cli.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15) at Function.Module._load (internal/modules/cjs/loader.js:690:27) at Module.require (internal/modules/cjs/loader.js:852:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (/Users/abhimatta/Documents/abhishek/accura-electron-dev/node_modules/builder-util/src/fs.ts:4:1) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Module.require (internal/modules/cjs/loader.js:852:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (/Users/abhimatta/Documents/abhishek/accura-electron-dev/node_modules/builder-util/src/util.ts:24:1) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14)
Package.json configurations

"electron": "^10.4.0",
"electron-builder": "^22.10.4",
"node": "10.22"

Same problem here... But your electron uses another node version (in my case), e.g.:

Electron v8.2.0 | Chromium v80.0.3987.158 | Node v12.13.0 | v8 v8.0.426.27-electron.0

So need to update Electron?

@abhishekmatcha, please try updating to node 12 then.

@Bartel-C8, yes, electron would need to be updated to one that supports Node 14.
Is that not possible for you to do?

We run on Electron 11 and apply a patch for node_modules/electron-updater/out/AppUpdater.js:

< const promises_1 = require("fs/promises"); > const promises_1 = require("fs").promises;
carloliaci, TiagoSilvaPereira, yceballost, rodeck826, RudyBekker, jordanmarshall12, dkapanidis, and singmnj reacted with thumbs up emoji eduboxgithub reacted with heart emoji All reactions

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

We run on Electron 11 and apply a patch for node_modules/electron-updater/out/AppUpdater.js :

< const promises_1 = require("fs/promises"); > const promises_1 = require("fs").promises;

This worked for me, Thank you :)

Facing the same issue with node-v16.13.0-win-x64 and electron-updater latest=4.6.1. I get this error:

Failed to start the electron application.
Error: Cannot find module 'fs/promises'

Fixing this one line:

const promises_1 = require("fs/promises");

and changing it to:

const promises_1 = require("fs").promises;

Everything seems to work fine.

Had the same issue, but can't update to Node 14 yet. Downgraded my electron-builder dependency to 22.10.5 and it worked

Hi, Can you share your package.json file

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.