Skip to content

Can't resolve node modules in Electron main process #203

@yonigel

Description

@yonigel

Hi,

I'm using Electron and I'm trying to use node module in the main process (i.e. path, fs), but getting following error:

Module not found: Error: Can't resolve 'fs' in '...\src\main'

For main window I'm using:

mainWindow = new BrowserWindow({
width: 900,
height: 680,
webPreferences: {
nodeIntegration: true,
nodeIntegrationInWorker: true
},
fullscreen: true
});

I saw this issue but it should work in electron main process as far as I understand.

Am I missing something?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions