electron-packager | Electron app with OS-specific bundles ( .app , .exe , etc | Runtime Evironment library

 by   electron JavaScript Version: 17.1.2 License: BSD-2-Clause

kandi X-RAY | electron-packager Summary

kandi X-RAY | electron-packager Summary

electron-packager is a JavaScript library typically used in Server, Runtime Evironment, Nodejs, Electron applications. electron-packager has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can install using 'npm i electron-packager' or download it from GitHub, npm.

Electron Packager is a command line tool and Node.js library that bundles Electron-based application source code with a renamed Electron executable and supporting files into folders ready for distribution. For creating distributables like installers and Linux packages, consider using either Electron Forge (which uses Electron Packager internally), or one of the related Electron tools, which utilizes Electron Packager-created folders as a basis. Note that packaged Electron applications can be relatively large. A zipped, minimal Electron application is approximately the same size as the zipped prebuilt binary for a given target platform, target arch, and Electron version (files named electron-v${version}-${platform}-${arch}.zip).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              electron-packager has a medium active ecosystem.
              It has 8230 star(s) with 808 fork(s). There are 134 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 28 open issues and 838 have been closed. On average issues are closed in 70 days. There are 9 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of electron-packager is 17.1.2

            kandi-Quality Quality

              electron-packager has 0 bugs and 0 code smells.

            kandi-Security Security

              electron-packager has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              electron-packager code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              electron-packager is licensed under the BSD-2-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              electron-packager releases are available to install and integrate.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.
              electron-packager saves you 57 person hours of effort in developing the same functionality from scratch.
              It has 150 lines of code, 0 functions and 46 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed electron-packager and discovered the below as its top functions. This is intended to give you an instant insight into electron-packager implemented functionality, and help decide if they suit your requirements.
            • Filter a JSON bundle identifier for the given key .
            Get all kandi verified functions for this library.

            electron-packager Key Features

            No Key Features are available at this moment for electron-packager.

            electron-packager Examples and Code Snippets

            ice-box,Pipelines
            JavaScriptdot img1Lines of Code : 25dot img1no licencesLicense : No License
            copy iconCopy
            var icebox = require('ice-box')('./ice-box')
            
            var packager = require('electron-packager')
            
            var src = process.argv[2]
            
            icebox(function (dst, done) {
              packager({
                dir: src,  // use the input dir, 'src'
                arch: 'x64',
                platform: 'linux',
                ou  
            Blocks (DataGenerator),How to build
            JavaScriptdot img2Lines of Code : 2dot img2License : Permissive (Apache-2.0)
            copy iconCopy
            npm install -g electron-packager
            
            npm start
              
            Development,打包
            JavaScriptdot img3Lines of Code : 2dot img3no licencesLicense : No License
            copy iconCopy
            npm run production
            
            electron-packager ./ --name=treex --version=1.1.1 --no-prune --icon=./assets/logo/treex-square.png.icns
              
            Electron app won't open after compiling for Win32 x64
            JavaScriptdot img4Lines of Code : 4dot img4License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            electron-packager   --platform= --arch= [optional flags...]
            
            electron-packager . ISS-Live-Locator --platform=win32 --arch=x64 --electronVersion=10.1.1
            
            Setp Apollo graphql in Quasar Framework v1
            JavaScriptdot img5Lines of Code : 32dot img5License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            Operating System - Linux(5.3.11-300.fc31.x86_64) - linux/x64
            NodeJs - 12.13.0
            
            Global packages
              NPM - 6.12.0
              yarn - 1.17.3
              @quasar/cli - 1.0.0-beta.2
              cordova - Not installed
            
            Important local packages
              quasar - 1.4.5 -- Build high-p
            How to run electron as root
            JavaScriptdot img6Lines of Code : 10dot img6License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            sudo chown root: root chrome-sandbox
            sudo chmod 4755 chrome-sandbox
            
            1. npm install ngx-electron electron
            2. npm install electron-packager --save-dev
            3. ionic build
            4. npx cap add electron
            5. ionic build && 
            exclude files from build in electron via package.json
            Lines of Code : 2dot img7License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            electron-packager  ./ --platform=win32 --arch=x64 --electron-version=8.2.3  --out=electron_build --overwrite --ignore="^.*\.py" --ignore="\/node_modules" --ignore="\/tests"
            
            Electron write file when packaged
            JavaScriptdot img8Lines of Code : 27dot img8License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            buildPath (String): The path to the temporary folder where your app has been copied to
            electronVersion (String): The version of electron you are packaging for
            platform (String): The target platform you are packaging for
            arch (String): The 
            'electron-packager' is not recognized as an internal or external command
            Lines of Code : 8dot img9License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            npm install -g electron-packager
            
            npm install -D electron-packager 
            
            npx electron-packager .
            
            ./node_modules/electron-packager/cli.js
            
            rcedit.exe failed with exit code 193. wine: Bad EXE format
            Lines of Code : 10dot img10License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            FROM node:10
            
            RUN dpkg --add-architecture i386 && apt-get update && apt-get install wine wine32 -y
            
            RUN npm install electron-packager -g
            
            VOLUME /electron
            WORKDIR /electron
            
            

            Community Discussions

            QUESTION

            Unsupported `GLOBAL_AGENT.HTTP_PROXY` configuration value: URL protocol must be "http:" when running electron-packager
            Asked 2022-Mar-24 at 06:09

            I was trying to package an Electron applicationusing electron-packager but get this error:

            ...

            ANSWER

            Answered 2022-Mar-24 at 06:09

            QUESTION

            Integrat @chilkat/ck-electron16-win-ia32 in electron project
            Asked 2022-Mar-17 at 08:03

            Actualy I try to intgrat but I face to this exception my node version is 16.3.2 32bit

            ...

            ANSWER

            Answered 2022-Mar-17 at 08:03

            SOLVED BY @chilkat Software by upgrading the current version of chilkat/ck-electron16-win64  and win32

            Source https://stackoverflow.com/questions/71427849

            QUESTION

            GLOBAL_AGENT.HTTP_PROXY not letting me build Electron Pacakge
            Asked 2022-Mar-15 at 02:40

            the problem

            ...

            ANSWER

            Answered 2022-Mar-15 at 02:40

            Actually this is a bug, has been fixed 5 hours ago (Mar 14, 2022, 9:55 PM GMT)

            GLOBAL_AGENT.HTTP_PROXY configuration value: URL protocol must be http

            Just do:

            Source https://stackoverflow.com/questions/71462161

            QUESTION

            Build electron as exe on macbook m1
            Asked 2022-Mar-09 at 09:15

            I trying to build an electron with an exe installer on macOS with a MacBook Pro with an m1. I already tried different packages like electron-packager, electron-forge, but unfortunately, none of my tries worked. Did anyone has a solution to build an electron version with an exe on macOS. My latest approach looked like, but when I start and after more then 30 minute it still do no finish.

            yarn run electron-forge make --arch=x64 --platform=win32

            The current code could be found here.

            ...

            ANSWER

            Answered 2022-Mar-09 at 09:15

            We using electron-builder for packaging electron app on Windows&MacOS(x86_x64/arm etc.), and you can try it.

            add some config in package.json, like this:

            Source https://stackoverflow.com/questions/71343833

            QUESTION

            Electron Compiled EXE Not working as expected
            Asked 2022-Feb-21 at 01:38

            I've been trying to "package" my Electron Application, using the below script, however when the .exe is created and I try to run said .exe I end up with an error listed below.

            I feel very stupid asking this; but what is the issue causing this as this is the first time experiencing Electron, ive read through countless documents, stackoverflow questions in relation to my issue with no avail.

            Script ...

            ANSWER

            Answered 2022-Feb-21 at 01:38

            electron-packager's prune option removes any packages from the final bundle that are listed in the devDependencies section.

            Since axios is listed there, it is removed from the bundle.

            You should put it into the dependencies section and rebuild the bundle.

            Source https://stackoverflow.com/questions/71193304

            QUESTION

            How can I fix the discrepancy between root directories when building an Electron.js project?
            Asked 2022-Feb-13 at 05:18

            When running my Electron project normally, like electron ./artist-test-kit-main.js, everything works fine. When I build the project into an executable, attempts to load files start failing, like: Uncaught Error: ENOENT: no such file or directory, open 'asset-editor\data.json' So I ran a test to see if there's a difference in the root directory between the normal (electron ./artist-test-kit-main.js) execution and the .exe's.

            Within index.js (launched by index.html, launched by artist-test-kit-main.js which is a standard electron.js initiator file):

            ...

            ANSWER

            Answered 2022-Feb-13 at 05:18
            TLDR

            Use __dirname instead of .

            Explanation

            . refers to the current working directory (cwd), which is the directory in which the node process was started.

            For an unpackaged app, this is usually the root folder of your project, producing the expected results. For a packaged app, the cwd will likely be where the Electron executable is stored. The app's contents (what was previously the root folder) are put inside resources/app or resources/app.asar relative to the executable.

            The way to unify the packaged and unpackaged scenarios is to use __dirname, which contains the directory of the currently running Node script. This way, it will be the same as using . in an unpackaged app, but will return the path with resources/app in the packaged scenario, as that is then the location of the currently running Node script.

            This is why you'll often see people using something like `file://${__dirname}/assets/index.html` to address files in Electron.

            Side note

            If you use require('./file.js'), the path is evaluated relative to the location of the calling script and will work as if you had used __dirname.

            Source https://stackoverflow.com/questions/71096959

            QUESTION

            Not able to play sound in electron app after packaging
            Asked 2021-Aug-31 at 06:26

            I have created an electron app consisting a sound effect. I am using the package sound-play to play the sound effect in my main.js file (learned from here). It is working as it should when I am running it through npm start. But after packaging my app using electron-packager, when I am running the exe file from "release-builds" folder, only the sound effect is not playing. All other aspects of the app are working fine.

            Shutter.mp3 is the sound file which is present in the project directory

            Main.js:

            ...

            ANSWER

            Answered 2021-Aug-31 at 06:26

            Edit: Similar to the electron-builder solution I listed below, I searched the electron-packager doc and found a similar option for extra files, instead of "files" you will use "extraResource", check it out in the docs.

            Original answer:

            If you are using webpack to bundle your app before packaging, see if you can include it in your Javascript file and have a file loader in your webpack explained here(blog site), here (Stack overflow), and of course here (webpack official) . Be sure to install File-loader!

            I prefer to use Electron builder for packaging apps, if you were to switch, you could include the file into your packaged app as follows:

            List the audio file in your JSON settings (package.json) to be included in your packager e.g.:

            Source https://stackoverflow.com/questions/68980034

            QUESTION

            Executable Electron App cannot find module
            Asked 2021-Aug-20 at 22:36

            I have an electron app that works when running locally, but when creating an executable it cannot find a module (JSON file) and I'm not sure why.

            The error I get is "Uncaught Exception" Cannot find module './data/background/background.json' Require Sack :

            ...

            ANSWER

            Answered 2021-Aug-20 at 22:36

            I think your problem is the --asar option.

            Because you have this option turned on electron-packager will package your source code into an app.asar file including your data folder.

            Because your data folder has now been compressed with all your other source code into this app.asar file your code can no longer access it.

            Solution 1:

            • Take out: --asar

            Solution 2:

            • Add this option: --extra-resource=\"./data\"
            • This'll tell electron-packager not to include ./data in the app.asar.

            Read more about --asar

            Read more about --extra-resource

            Also see this StackOverflow question

            Source https://stackoverflow.com/questions/68868285

            QUESTION

            Icon not changing in the file location electron
            Asked 2021-Jul-31 at 08:16

            I used electron and I made my first calculator app. I packaged the app using electron-packager. So now after doing this I tried to set an icon. However, it is showing in the start menu but not in the file location. Please check the below pics and help me if you can:

            Thank you in advance,

            ...

            ANSWER

            Answered 2021-Jul-31 at 02:09

            I had similar issue, so I put icon in root project. change build script into something like this. It solved the problem.

            calculator.png is in root project.

            Source https://stackoverflow.com/questions/68585276

            QUESTION

            Electron does not show images in compiled version
            Asked 2021-Jul-27 at 19:51

            I'm trying to solve a problem about the electron.

            It doesn't show any image coming from a css file, on the other hand, it can show it normally in a previous version, without compiling the application.

            How my project is organized.

            main.js file (I hid some useless information "width, height...")

            ...

            ANSWER

            Answered 2021-Jul-27 at 19:51

            Packaging apps always messes with the file paths.
            Just use relative file paths.

            Source https://stackoverflow.com/questions/68549655

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install electron-packager

            This module requires Node.js 10.0 or higher to run. It is not recommended to install electron-packager globally.

            Support

            Electron Packager is known to run on the following host platforms:.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i electron-packager

          • CLONE
          • HTTPS

            https://github.com/electron/electron-packager.git

          • CLI

            gh repo clone electron/electron-packager

          • sshUrl

            git@github.com:electron/electron-packager.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link