angular-electron icon indicating copy to clipboard operation
angular-electron copied to clipboard

npm install trowing error

Open nandakola opened this issue 5 years ago • 5 comments

npm install throwing the following error.

"Cannot find module 'fs/promises'"

Node Ver 12.*

nandakola avatar Aug 27 '21 12:08 nandakola

@nandakola This seems like an environment issue not related to this repo. Can you give your full node version?

daxsom avatar Aug 27 '21 15:08 daxsom

@daxsom v12.22.5

nandakola avatar Aug 27 '21 16:08 nandakola

@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.

daxsom avatar Aug 27 '21 17:08 daxsom

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-deps npm 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+.

daxsom avatar Aug 27 '21 17:08 daxsom

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.

stale[bot] avatar Sep 19 '21 19:09 stale[bot]