npm install trowing error
npm install throwing the following error.
"Cannot find module 'fs/promises'"
Node Ver 12.*
@nandakola This seems like an environment issue not related to this repo. Can you give your full node version?
@daxsom v12.22.5
@nandakola Odd, seems like that should be fine. v12.22.5 is LTS and should have fs/promises
https://nodejs.org/docs/v12.22.5/api/fs.html#fs_fs_promises_api
I'll spin up a VM and try to reproduce if someone doesn't have a better answer in the meantime.
Ok I reproduced
[email protected] postinstall /home/david/projects/angular-electron electron-builder install-app-deps
Error: Cannot find module 'fs/promises' Require stack:
- /home/david/projects/angular-electron/node_modules/builder-util/out/fs.js
- /home/david/projects/angular-electron/node_modules/builder-util/out/util.js
- /home/david/projects/angular-electron/node_modules/electron-builder/out/cli/cli.js
- /home/david/projects/angular-electron/node_modules/electron-builder/cli.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.
(/home/david/projects/angular-electron/node_modules/builder-util/src/fs.ts:4:1) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (/home/david/projects/angular-electron/node_modules/builder-util/src/util.ts:24:1) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] postinstall: electron-builder install-app-depsnpm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! /home/david/.npm/_logs/2021-08-27T17_44_49_656Z-debug.log
Readme shows
"Angular CLI & Electron Builder needs Node 14 or later to work correctly."
Not sure of the exact circumstances but looks like you will have to upgrade to Node 14+.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.