diff --git a/npm/index.js b/npm/index.js index 74b576ef9fe3..a49932aa2027 100644 --- a/npm/index.js +++ b/npm/index.js @@ -1,4 +1,10 @@ var fs = require('fs') var path = require('path') -module.exports = path.join(__dirname, fs.readFileSync(path.join(__dirname, 'path.txt'), 'utf-8')) +const pathFile = path.join(__dirname, 'path.txt') + +if (fs.existsSync(pathFile)) { + module.exports = path.join(__dirname, fs.readFileSync(pathFile, 'utf-8')) +} else { + throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again'); +}