Thanks to visit codestin.com
Credit goes to github.com

Skip to content

install.js judge the path.txt always fail #49983

@linxiaowu66

Description

@linxiaowu66

Preflight Checklist

Electron Version

40.6.1

What operating system(s) are you using?

macOS

Operating System Version

macOs 26.3

What arch are you using?

x64

Last Known Working Electron version

No response

Does the issue also appear in Chromium / Google Chrome?

I don't know how to test

Expected Behavior

npm install electron will postinstall the install.js, and this if statement always return fail:

function isInstalled () {
  try {
    if (fs.readFileSync(path.join(__dirname, 'dist', 'version'), 'utf-8').replace(/^v/, '') !== version) {
      return false;
    }

    if (fs.readFileSync(path.join(__dirname, 'path.txt'), 'utf-8') !== platformPath) {
      return false;
    }
  } catch (ignored) {
    return false;
  }

  const electronPath = process.env.ELECTRON_OVERRIDE_DIST_PATH || path.join(__dirname, 'dist', platformPath);

  return fs.existsSync(electronPath);
}

as the dist of electron package does not exits the path.txt, in the electron v28, the path.txt is exist.

Actual Behavior

ignore the if statement, if the path.txt file is not exist as expected, why the install.js should be used ?

Testcase Gist URL

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    👀 Unsorted Items

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions