0
votes

I am trying to build a test app using Electron in my Windows 7 x86. I have Node.js, npm, electron and electron-packager installed. The project's directory structure looks like this:

app
   package.json
   main.js
   index.htlm

I have the following in my package.json file:

{
    "name" : "TestApp",
    "main" : "main.js",
    "version" : "0.01",
    "scripts" : {
        "start" : "electron .",
        "package" : "electron-packager / TestApp --platform=win32 --arch=ia32 --verson=0.30.2 --overwrite "
    }
}

And here is the image of what's happening,

enter image description here after reading the script, it freezes (or I don't know what happens) and nothing happens. I waited for 15-20 minutes but there is no progress after reaching this step. Can someone please help!

1
In the command which I use, after electron-packager I have a . and not a /. Change that and see if it works. Also, you have a typo. It should be --version whereas you have --verson. You are missing the i. - shashi

1 Answers

0
votes

If you run your npm package command from within the app directory, the command in your package.json file should be configured as:

{
    "name" : "TestApp",
    "main" : "main.js",
    "version" : "0.01",
    "scripts" : {
        "start" : "electron .",
        "package" : "electron-packager . TestApp --platform=win32 --arch=ia32 --verson=0.30.2 --overwrite "
    }
}

Note that the electron-packager . in the above line indicates the current location is the directory of the application to be packaged.