index.js:8 Uncaught TypeError: Cannot read properties of null (reading 'existsSync')
at getElectronPath (index.js:8:10)
at node_modules/.pnpm/registry.npmmirror.com+electron@23.0.0-beta.8/node_modules/electron/index.js (index.js:21:18)
at __require2 (chunk-SR54VZQL.js?v=2c462924:18:50)
at electron.js?v=2c462924:7:16
index.js from electron node_module:
const fs = require('fs');
const path = require('path');
const pathFile = path.join(__dirname, 'path.txt');
function getElectronPath () {
let executablePath;
if (fs.existsSync(pathFile)) {
executablePath = fs.readFileSync(pathFile, 'utf-8');
}
if (process.env.ELECTRON_OVERRIDE_DIST_PATH) {
return path.join(process.env.ELECTRON_OVERRIDE_DIST_PATH, executablePath || 'electron');
}
if (executablePath) {
return path.join(__dirname, 'dist', executablePath);
} else {
throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again');
}
}
module.exports = getElectronPath();
error:
index.js
from electron node_module:env: