Electron Js - A javascript error occurred in the main process
Asked Answered
F

1

6

I have created an electron project which is working fine but when I try to package an electron app using electron packager and then run it. I am facing an exception

Uncaught Exception: Error: Cannot find module Require stack 'E:\app-folder..release-builds\app-win32-ia32\resources\app....\node_sqlite3.node'

click here to see Error

'Here is my package.json'

{
    "name": "app",
    "version": "1.0.0",
    "main": "main.js",
    "devDependencies": {
        "electron": "^8.2.0",
        "electron-builder": "^22.8.0",
        "electron-rebuild": "^1.10.1"
    },
    "scripts": {
        "start": "electron .",
        "rebuild": "electron-rebuild -f -w sqlite3",
        "package-win": "electron-packager . App--overwrite --platform=win32 --arch=ia32 --icon=assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"App\"",
        "postinstall": "electron-builder install-app-deps"
    },
    "dependencies": {
        "axios": "^0.19.2",
        "concat-stream": "^2.0.0",
        "datatables.net": "^1.10.20",
        "datatables.net-dt": "^1.10.20",
        "ejs": "^3.1.5",
        "electron-packager": "^15.0.0",
        "express-validator": "^6.6.1",
        "form-data": "^3.0.0",
        "jquery": "^3.5.0",
        "nodemailer": "^6.4.11",
        "sqlite3": "^5.0.0"
    } 

}

Fad answered 11/9, 2020 at 10:12 Comment(0)
N
0
npm install --save-dev @electron-forge/cli
npm run package

try running these commands you will get an out folder and the application is present in that out folder

Namedropper answered 6/7, 2021 at 6:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.