Skip to content

Installing Electron fails under Node.js 26.1.0+ and 24.16.0+ #51619

Closed
yourtoolshq/everyday
#87

Description

@khassel

Preflight Checklist

Electron Version

42.0.1

What operating system(s) are you using?

Other Linux

Operating System Version

debian trixie

What arch are you using?

x64

Last Known Working Electron version

No response

Does the issue also appear in Chromium / Google Chrome?

No

Expected Behavior

Running npx install-electron should install the electron binaries under node_modules/...

Actual Behavior

Binaries are not installed. The extraction of the zip file fails because of this problem in the used extract-zip npm package.

Testcase Gist URL

No response

Additional Information

Electron v42.x installation fails on latest node v26.x and v24.x versions.

Pinned by nikwen

Activity

  1. added theissue type on May 13, 2026
  2. moved this to 👀 Unsorted Items in 42-x-yon May 13, 2026
  3. nikwen commented on May 14, 2026

    @nikwen
    Member

    Thanks for reporting and linking the upstream issue!

    CC @erickzhao (who wrote the new installation feature) and @malept (who I believe has push access to extract-zip)

    EDIT: Erick told me that his PR didn't touch this part of the extraction process (so it should also happen on Electron 41 and below), but that he'll likely be able to look into the issue.

  4. khassel commented on May 15, 2026

    @khassel
    Author

    Thanks for looking into this, can confirm that this also occurs with electron v41 and v40 (under node v26.1.0).

  5. Moomito commented on May 16, 2026

    @Moomito

    Same issue here, Arch Linux, 26.1.0 did not work, downgrading to node 24 fixed it. Electron 42.0.1, and 42.1 seemingly too.

  6. link2xt commented on May 17, 2026

    @link2xt

    I did some console.log debugging by running node on the install.js directly, and in my case what happens is that extractFile is called, but the promise it returns is not and path.txt is not written:

    electron/npm/install.js

    Lines 82 to 95 in b36120f

    return extract(zipPath, { dir: path.join(__dirname, 'dist') }).then(() => {
    // If the zip contains an "electron.d.ts" file,
    // move that up
    const srcTypeDefPath = path.join(distPath, 'electron.d.ts');
    const targetTypeDefPath = path.join(__dirname, 'electron.d.ts');
    const hasTypeDefinitions = fs.existsSync(srcTypeDefPath);
    if (hasTypeDefinitions) {
    fs.renameSync(srcTypeDefPath, targetTypeDefPath);
    }
    // Write a "path.txt" file.
    return fs.promises.writeFile(path.join(__dirname, 'path.txt'), platformPath);
    });

    extract() is called (i tested by adding console.log to node_modules/.pnpm/[email protected]/node_modules/extract-zip/index.js, and it extracts v8_context_snapshot.bin but not the other files from ~/.cache/electron/9ae33c148c9d1a94c0e65d63fdc2c1443b43977f61a3f2679788e0d5d7d2d370/electron-v41.6.0-linux-x64.zip.

    $ DEBUG=extract-zip node ./node_modules/.pnpm/[email protected]/node_modules/electron/install.js
      extract-zip creating target directory /home/user/src/deltachat/deltachat-desktop/node_modules/.pnpm/[email protected]/node_modules/electron/dist +0ms
      extract-zip opening /home/user/.cache/electron/9ae33c148c9d1a94c0e65d63fdc2c1443b43977f61a3f2679788e0d5d7d2d370/electron-v41.6.0-linux-x64.zip with opts {
      dir: '/home/user/src/deltachat/deltachat-desktop/node_modules/.pnpm/[email protected]/node_modules/electron/dist'
    } +2ms
      extract-zip zipfile entry v8_context_snapshot.bin +2ms
      extract-zip extracting entry { filename: 'v8_context_snapshot.bin', isDir: false, isSymlink: false } +0ms
      extract-zip mkdir {
      dir: '/home/user/src/deltachat/deltachat-desktop/node_modules/.pnpm/[email protected]/node_modules/electron/dist',
      recursive: true
    } +1ms
      extract-zip opening read stream /home/user/src/deltachat/deltachat-desktop/node_modules/.pnpm/[email protected]/node_modules/electron/dist/v8_context_snapshot.bin +0ms 
    
  7. link2xt commented on May 17, 2026

    @link2xt

    There is an extract-zip issue: max-mapper/extract-zip#154

    EDIT: this issue is actually referenced in the first post.

  8. AlfredoCubitos commented on May 18, 2026

    @AlfredoCubitos

    Same problem with dietpi on raspberry 4.
    Installation process throws no errors even with --verbose option

    npm install --verbose electron
    npm verbose cli /usr/local/bin/node /usr/local/bin/npm
    npm info using [email protected]
    npm info using [email protected]
    npm verbose title npm install electron
    npm verbose argv "install" "--loglevel" "verbose" "electron"
    npm verbose logfile logs-max:10 dir:/root/.npm/_logs/2026-05-18T15_00_22_507Z-
    npm verbose logfile /root/.npm/_logs/2026-05-18T15_00_22_507Z-debug-0.log
    npm verbose shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules
    npm http cache https://registry.npmjs.org/electron 136ms (cache hit)
    npm http cache electron@https://registry.npmjs.org/electron/-/electron-42.1.0.tgz 0ms (cache hit)
    npm http cache electron-nightly@https://registry.npmjs.org/electron-nightly/-/electron-nightly-44.0.0-nightly.20260515.tgz 0ms (cache hit)
    
    added 1 package, and changed 1 package in 5s
    
    225 packages are looking for funding
      run `npm fund` for details
    npm verbose cwd /root/MagicMirror
    npm verbose os Linux 6.18.29+rpt-rpi-v8
    npm verbose node v26.1.0
    npm verbose npm  v11.14.1
    npm verbose exit 0
    npm info ok
    
    
    
    node -v
    Node.js v26.1.0
    

    Error Message:

    Downloading Electron binary...
    node:fs:436
        return binding.readFileUtf8(path, stringToFlags(options.flag));
                       ^
    
    Error: ENOENT: no such file or directory, open '/root/MagicMirror/node_modules/electron/path.txt'
        at Object.readFileSync (node:fs:436:20)
        at getElectronPath (/root/MagicMirror/node_modules/electron/index.js:47:25)
        at Object.<anonymous> (/root/MagicMirror/node_modules/electron/index.js:52:18)
        at Module._compile (node:internal/modules/cjs/loader:1856:14)
        at Object..js (node:internal/modules/cjs/loader:1996:10)
        at Module.load (node:internal/modules/cjs/loader:1579:32)
        at Module._load (node:internal/modules/cjs/loader:1381:12)
        at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
        at Module.require (node:internal/modules/cjs/loader:1602:12)
        at require (node:internal/modules/helpers:191:16) {
      errno: -2,
      code: 'ENOENT',
      syscall: 'open',
      path: '/root/MagicMirror/node_modules/electron/path.txt'
    }
    
    
  9. 97 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

42-x-ybug 🪲component/buildplatform/linuxstatus/confirmed

Type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions