I recently started using electron. I have successfully completed the 1st phase by creating a hello world app (included files index.html, main.js, package.json). Now I am trying to package the app using electron-packager but getting this error
Steps I have followed:
npm init
command.npm install electron --save-dev
.npm start
to execute the application.npm install electron-packager
.electron-packager .
This make command contains two steps: It will first run electron-forge package under the hood, which bundles your app code together with the Electron binary. The packaged code is generated into a folder. It will then use this packaged app folder to create a separate distributable for each configured maker.
electron-builder builds the Electron app for the current platform and current architecture as the default target. macOS: DMG and ZIP for Squirrel.Mac. Windows: NSIS (.exe) Linux: If you build on Windows or macOS, Snap and AppImage for x64 will be the output.
Perform a global package install:
npm install -g electron-packager
The -g
flag tells NPM to install the package globally which makes the command electron-packager
available in your PATH.
If you don't want to do a global install you can install it locally and run with npx
.
npm install -D electron-packager
npx electron-packager .
Alternatively, you can reference it straight from the node_modules folder (not recommended).
./node_modules/electron-packager/cli.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With