Can Electron-builder be packaged using npm instead of yarn?

I have recently developed a Python3 application using the Electron framework, which is built on top of Node.js.
To set up dependencies and launch the app, I installed them using npm and run it with npm start.

After referring to the Electron documentation, it appears that Electron-builder is the recommended tool for distributing my app across all platforms. However, the installation instructions suggest using yarn instead of npm due to potential issues with npm functionality: refer to this related ticket

My main query is: since the linked ticket dates back to 2017, can the distribution still be achieved using npm? If so, how?

If leveraging npm is not feasible, what steps should I take to migrate my code to yarn?

Just for context:
I encounter a significant error message when running npm run dist. Should you need it, I am willing to share the error details (alongside my package.json file)

Thank you in advance.

UPDATE: including error log and package.json file

{
  "name": "APP_NAME",
  "version": "1.0.0",
  "description": "The initial release of APP_NAME's graphical user interface.",
  "main": "index.js",
  "homepage": "https://docenhance.com",
  "author": "DocEnhance <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cfa1a0a0bbaea4ba8fa8a2aea6a3e1aca0a2">[email protected]</a>>",
  "license": "MIT",
  "scripts": {
    "postinstall": "electron-builder install-app-deps",
    "start": "npm install && electron .",
    "pack": "electron-builder --dir",
    "dist": "electron-builder"
  },
  "build": {
    "appId": "com.docenhance.APP_NAME",
    "productName": "APP_NAME - PROJECT_NAME",
    "linux": {
      "target": "deb",
      "icon": "build/icon.icns",
      "category": "Office"
    }
  },

  "devDependencies": {
    "bootstrap": "^4.1.2",
    "electron": "^4.0.7",
    "electron-builder": "^20.39.0",
    "jquery": "^3.3.1"
  },
  "dependencies": {
    "bootstrap": "^4.3.1",
    "jquery": "^3.3.1",
    "popper.js": "^1.14.7",
    "python-shell": "^1.0.7"
  }
}

You can access the error log file HERE.

Answer №1

A solution using npm is available for the yargs issue, you can find more information here.

Your error messages are providing insight into the specific issues you are facing.

Error output: [ERROR] Unknown input file format: /home/MYUSERNAME/Documents/APP_DIRECTORY/dist/.icon-set/icon_ICN#.jp2 Known file formats are *.j2k, *.jp2, *.jpc or *.jpt

If you are encountering this error on Linux, it might be due to specifying a .icns file format for your icon, which is typically used for OSX. Electron Builder may not recognize this format on Linux based on the error message.

"linux": {
      "target": "deb",
      "icon": "build/icon.icns",
      "category": "Office"
    }

The remaining errors are likely stemming from this initial icon format issue.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

execute function once eventlistener completes running

I've implemented a code snippet to detect the availability of a gyroscope for user interaction. Here's how it works: function check_user_hardware(){ window.addEventListener("devicemotion", function(event){ if(event.rotationRate.alpha ...

Retrieving a string during an update request within the KendoUI datasource

I am facing an issue with my grid and data source setup. The schema.parse function is causing some unexpected behavior. Whenever I try to update or create a new row, the schema.parse() function is called again. The parameter passed to it is a string conta ...

The current context does not have a reference to TextBox

I am encountering an issue with my simple aspx page. Despite not using Master Content Page, I am seeing the following error: The name 'txtFirstName' does not exist in the current context Here is my Markup: <%@ Page Language="C#" %> &l ...

Tips for implementing a nested ng-repeat with nested JSON array data triggered by a button click

Assuming I have assigned the following JSON data to $scope.people: [ { "personId": 1, "name": "Thomas", "age": 39, "friends": [ { "friendId": 1, "nickName": "Lefty" ...

What steps do I need to take to ensure that Phaser implements modifications made in my game.js file?

I recently completed the Phaser Tutorial and set up my project with an index.html file and a game.js file, along with downloading the phaser.min.js file. All files are located in the same folder. Although I have connected everything correctly and the outp ...

What is the best way to include generic HTML content in an Angular 2 component?

I am looking to design a versatile modal component that can accommodate various elements, ranging from text to images and buttons. If I were to implement something like the following: <div class="Modal"> <div class="header"></div> ...

I'm experiencing some difficulties utilizing the return value from a function in Typescript

I am looking for a way to iterate through an array to check if a node has child nodes and whether it is compatible with the user's role. My initial idea was to use "for (let entry of someArray)" to access each node value in the array. However, the "s ...

Creating a redirect button using React Material UI and React Router

I've been exploring how to use Material-UI with React and I'm struggling to figure out the best way to redirect to other pages or components. After reading various articles on different methods of redirection using react-router-dom, I still have ...

Utilizing a parent scope variable in a callback function

This question delves more into the concept of JavaScript Closures rather than Firebase. The issue arises in the code snippet below, where the Firebase callback fails to recognize the variable myArr from the outer scope. function show_fb() { var myAr ...

The Socket.io application is facing deployment issues on the Heroku platform

I have developed a simple chat server using nodejs, socket.io, and express, and now I am attempting to deploy it on Heroku using my Git repository. However, when I access the Herokuapp website for my application (), the display is not as expected: https:/ ...

Prepending a prefix to every value in a JSON dump

I have been working on developing a lexer that generates tokens and then outputs them as a JSON list. These tokens are in the form of named tuples. Specifically, I have defined my tokens like this: Token = namedtuple('Token', ['kind', ...

Ensure to update the npm package version before making any Git commit

My project is built with Ember using NPM and I utilize Git for version control. I am looking for a way to update or bump the package.json version before or during a Git commit. Is there a method to accomplish this? Should I be implementing Git hooks? ...

Exploring the Concept of Dependency Injection in Angular 2

Below is a code snippet showcasing Angular 2/Typescript integration: @Component({ ... : ... providers: [MyService] }) export class MyComponent{ constructor(private _myService : MyService){ } someFunction(){ this._mySer ...

Validating forms using Ajax in the Model-View-Controller

I am facing an issue with my Ajax form, where I need to trigger a JavaScript function on failure. The code snippet looks like this: using (Ajax.BeginForm("UpdateStages", new AjaxOptions { HttpMethod = "POST", OnSuccess = "refreshSearchResults(&apo ...

How can you ensure that the Data Point Values are always displayed when using arrayToDataTable in the Google Charts API?

Just wanted to clarify that even though there is a similar question titled: Google Charts API: Always show the Data Point Values in Graph ...on this website, I am facing difficulties implementing its solution because my chart is using arrayToDataTable. ...

Migrate the JavaScript variable created with 'passport' to an Express router

In my quest for authentication, I created the essential passportAuth.js file: module.exports = function(passport, FacebookStrategy, config, mongoose, fbgraph){ passport.serializeUser(function(user,done){ //to make user reference available across pages ...

Error: The JSON input unexpectedly ended, however the PHP file itself is error-free

When trying to display data retrieved using PHP through JSON/Ajax, I encountered an error message: [object Object] | parsererror | SyntaxError: Unexpected end of JSON input The PHP script is functional (I can view the JSON output by directly accessing th ...

When working with Angular 2 and Typescript, a common error message that may be encountered is "TypeError

Currently diving into Angular 2 and encountered a stumbling block while attempting to create a service. Despite my efforts in finding a solution, I seem to be missing something crucial. Error: A problem arises in angular2-polyfills.js:1243 with the error ...

Store vueJs data in browser's localStorage

Is there a way to save the state of my game even after a page refresh using local or session storage? I've successfully stored wins in localStorage, but I'm struggling to keep the table with "X" and "O" in the same spot after a refresh. Any sugge ...

How to calculate large integer powers efficiently in JavaScript using the mod

I'm currently on the lookout for a reliable JavaScript algorithm as I attempted to implement one using node.js : function modpow_3(a,n, module){ var u = BigInt('1'); var e = equals(a, u); if( e) return a; if(equalsZero(a)) return a; if(pair ...