electrion vue __dirname is a NodeJS variable

__dirname is a NodeJS variable, in recent electron versions, node integration is disabled by default. When opening your BrowserWindow, you should add the following to the options:


module.exports = {
    pluginOptions: {
        electronBuilder: {
            nodeIntegration: true
        }
    }
}

this seems to solve it for most people (for me sadly enough i now get the next error: fs.existsSync is not a function)

原文地址:https://www.cnblogs.com/xiaoruilin/p/15057644.html