electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.47k stars 1.72k forks source link

"install-app-deps" Error #8157

Closed arnon001 closed 3 months ago

arnon001 commented 3 months ago

in the post install I'm getting this error:


  • loaded configuration file=package.json ("build" field)
  • rebuilding native production dependencies platform=win32 arch=x64
Error: npm.cmd exited with code 1
Error output:
npm ERR! code 1
npm ERR! path C:\Users\Arnon\Desktop\FLL-TMS\launcher\node_modules\sqlite3
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install -r napi || node-gyp rebuild
npm ERR! prebuild-install warn This package does not support N-API version 4.2.12
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@18.19.1 | win32 | x64
npm ERR! gyp info find Python using Python version 3.12.2 found at "C:\Python312\python.exe"
npm ERR! gyp http GET https://atom.io/download/electron/v4.2.12/node-v4.2.12-headers.tar.gz
npm ERR! gyp http 200 https://github.blog/2022-06-08-sunsetting-atom/
npm ERR! gyp WARN install got an error, rolling back install
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: TAR_BAD_ARCHIVE: Unrecognized archive format
npm ERR! gyp ERR! stack     at Unpack.warn (C:\Users\Arnon\Desktop\FLL-TMS\launcher\node_modules\tar\lib\warn-mixin.js:21:40)
npm ERR! gyp ERR! stack     at Unpack.warn (C:\Users\Arnon\Desktop\FLL-TMS\launcher\node_modules\tar\lib\unpack.js:236:18)
npm ERR! gyp ERR! stack     at Unpack.<anonymous> (C:\Users\Arnon\Desktop\FLL-TMS\launcher\node_modules\tar\lib\parse.js:83:14)
npm ERR! gyp ERR! stack     at Unpack.emit (node:events:529:35)
npm ERR! gyp ERR! stack     at [emit] (C:\Users\Arnon\Desktop\FLL-TMS\launcher\node_modules\tar\lib\parse.js:313:12)
npm ERR! gyp ERR! stack     at [maybeEnd] (C:\Users\Arnon\Desktop\FLL-TMS\launcher\node_modules\tar\lib\parse.js:468:17)
npm ERR! gyp ERR! stack     at [consumeChunk] (C:\Users\Arnon\Desktop\FLL-TMS\launcher\node_modules\tar\lib\parse.js:500:21)
npm ERR! gyp ERR! stack     at Unpack.write (C:\Users\Arnon\Desktop\FLL-TMS\launcher\node_modules\tar\lib\parse.js:427:25)
npm ERR! gyp ERR! stack     at Unpack.end (C:\Users\Arnon\Desktop\FLL-TMS\launcher\node_modules\tar\lib\parse.js:548:14)
npm ERR! gyp ERR! stack     at ShaSum.endFn (node:internal/streams/pipeline:430:11)
npm ERR! gyp ERR! stack     at Object.onceWrapper (node:events:631:28)
npm ERR! gyp ERR! stack     at ShaSum.emit (node:events:529:35)
npm ERR! gyp ERR! stack     at endReadableNT (node:internal/streams/readable:1400:12)
npm ERR! gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19045
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Arnon\\Desktop\\FLL-TMS\\launcher\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\Arnon\Desktop\FLL-TMS\launcher\node_modules\sqlite3
npm ERR! gyp ERR! node -v v18.19.1
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Arnon\AppData\Local\npm-cache\_logs\2024-03-27T21_17_36_658Z-debug-0.log

    at ChildProcess.<anonymous> (C:\Users\Arnon\AppData\Roaming\npm\node_modules\electron-builder\node_modules\builder-util\src\util.ts:251:14)
    at Object.onceWrapper (node:events:632:26)
    at ChildProcess.emit (node:events:517:28)
    at maybeClose (node:internal/child_process:1098:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:303:5)
From previous event:
    at rebuild (C:\Users\Arnon\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\out\util\yarn.js:233:18)
    at C:\Users\Arnon\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\src\util\yarn.ts:20:11
From previous event:
    at installOrRebuild (C:\Users\Arnon\AppData\Roaming\npm\node_modules\electron-builder\node_modules\electron-builder-lib\out\util\yarn.js:68:17)
    at C:\Users\Arnon\AppData\Roaming\npm\node_modules\electron-builder\src\cli\install-app-deps.ts:57:5
    at Generator.next (<anonymous>)
From previous event:
    at installAppDeps (C:\Users\Arnon\AppData\Roaming\npm\node_modules\electron-builder\out\cli\install-app-deps.js:174:17)
    at C:\Users\Arnon\AppData\Roaming\npm\node_modules\electron-builder\src\cli\cli.ts:43:10
    at processImmediate (node:internal/timers:476:21)
From previous event:
    at Object.handler (C:\Users\Arnon\AppData\Roaming\npm\node_modules\electron-builder\src\cli\cli.ts:43:10)
    at Object.runCommand (C:\Users\Arnon\AppData\Roaming\npm\node_modules\electron-builder\node_modules\yargs\lib\command.js:235:44)
    at Object.parseArgs [as _parseArgs] (C:\Users\Arnon\AppData\Roaming\npm\node_modules\electron-builder\node_modules\yargs\yargs.js:1022:30)
    at Object.get [as argv] (C:\Users\Arnon\AppData\Roaming\npm\node_modules\electron-builder\node_modules\yargs\yargs.js:965:21)
    at Object.<anonymous> (C:\Users\Arnon\AppData\Roaming\npm\node_modules\electron-builder\src\cli\cli.ts:28:22)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Module.load (node:internal/modules/cjs/loader:1197:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1013:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
    at node:internal/main/run_main_module:28:49```
mmaietta commented 3 months ago

Looks like your electron version is invalid such that node-gyp is not able to download any headers

npm ERR! gyp http GET https://atom.io/download/electron/v4.2.12/node-v4.2.12-headers.tar.gz
npm ERR! gyp http 200 https://github.blog/2022-06-08-sunsetting-atom/
npm ERR! gyp WARN install got an error, rolling back install
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: TAR_BAD_ARCHIVE: Unrecognized archive format

If you check via your browser, notice how https://atom.io/download/electron/v4.2.12/node-v4.2.12-headers.tar.gz redirects to https://github.blog/2022-06-08-sunsetting-atom/ You're welcome to try a more recent version of electron-builder, such as v25.0.0-alpha.5, that utilizes electron's official node rebuilder. That being said, pretty sure you need to update your electron version first