Running App using Electron

As per info supplied here: Using Node and Electron to build Desktop Apps - NSB App Studio

Hi, I’m trying to build a Desktop app (Windows) using the Electron procedure. I have installed latest node package, put in an icon(512) and I have set the dimensions I want my app to run with. When I try to run the app using Electron, a black window appears briefly and that is it? An electron folder appears in my NSB projects folder with what looks to be all the relevent files and information. How do I get this to run?

In AppStudio’s About screen, there is a View Log button.

Anything there?

I’ll check that. I’m assuming that I have to update the Dependencies i.e Current Dependencies in my App studio are:

"devDependencies": {
    "electron": "^7.1.0",
    "electron-builder": "^22.0.0",
    "npm": "^6.13.0"

I believe they should now be: (Could you let me Know if this is correct thanks)

"devDependencies": {
   "electron": "^16.14.0",
   "electron-builder": "^22.14.13",
   "npm": "^8.3.1"

Based on the following info

Latest Electron builder version: 22.14.13

Latest LTS node version: 16.14.0 (includes npm 8.3.1) Download | Node.js

However there is another version of npm avaliable but I don’t think it’s included in the latest LTS version : Latest npm version: 8.5.3

Checked the view log after trying to run Electron app and tis is what I get:

2022-03-07 11:02:18,529 - JFormat - ERROR - TOOLBOX/PROJECT BUG! FIX ME!
2022-03-07 11:02:18,529 - JFormat - ERROR - borderWidth.isdigit()
2022-03-07 11:02:18,529 - JFormat - ERROR - ‘int’ object has no attribute ‘isdigit’
2022-03-07 11:02:18,529 - JFormat - ERROR - TOOLBOX/PROJECT BUG! FIX ME!
2022-03-07 11:02:18,529 - JFormat - ERROR - borderWidth.isdigit()
2022-03-07 11:02:18,529 - JFormat - ERROR - ‘int’ object has no attribute ‘isdigit’

Am I to assume that I can’t have a boarder with an Electron app? Or, is there something else I can do to kep it.

‘int’ object has no attribute ‘isdigit’ Is this an intiger function that isn’t being used within my app?Something like

Is that everything you see there?

These messages are unrelated to Electron and can be ignored.

Yes, from the view log window if I was to copy to clipboard it would be around 2 pages of A4 of what I have shown in my previous post.

Go ahead and send me the full log info directly.

Thanks for sending along the log.

Node can be a pain.

Here’s the important message from log:

2022-03-07 11:03:31,757 - IDEController - INFO - npm: config set scripts-prepend-node-path auto
2022-03-07 11:03:31,757 - IDEController - INFO - npmPath: C:\Program Files\NSB AppStudio\node\bin\node, C:\Program Files\NSB AppStudio\node\node_modules\npm\bin\npm-cli.js
2022-03-07 11:03:33,132 - IDEController - INFO - TypeError: Class extends value undefined is not a constructor or null

Here is a similar problem on StackOverflow.

Thanks for doing that for me :+1: I had a look at the problems the folks were having on StackOverflow and I did do an uninstall and then reinstalled node.Same problem. I then tried to install of previous versions (node 12.14.1 and 16.13.2) but unfortunately ended up with the same result. I think I’m going to have to put this on the back burner for now as it’s for myself anyway. Just one thought, could it be the node.exe file needs updating in the AppStudio node bin?

The node.exe file currently built into AppStudio is v16.13.1.

Thanks, I’ll download that version of node and see what happens.

node 16.13.1
npm 8.1.2

One more question, do I use the current Electron Builder i.e 22.14.13 or would I have to use an older one that was origeonally asociated with the above mentioned node and npm versions?

Just a quick update, I after running with node v 16.13.1, I no longer get any mention of node error in the log file (Checked from log folder not window in app studio) Still doesn’t run though. It 's difficult to find what version number of electron builder to use. It can be narrowed down to several versions even though there is only a month between Node 16.13.1 and Node 16.13.2.
Dates here Previous Releases | Node.js and
Electron builder dates here I tried running with all of them, no node error like before but still doesn’t run.

Finally got there, you have to use node-v16.13.1 which has to match the .exe file within app studio and you have to use the following dependencies which I’m assuming are also within app studio (Even though node-v16.3.1 comes with it’s own npm version)
Dependencies used are

  "author": "",
  "license": "ISC",
  "repository": "",
  "devDependencies": {
   "electron": "^12.0.5",
   "electron-builder": "^22.10.5",
   "npm": "^7.11.1"

Need to work out what the ReferenceError is now,

Have you tried creating a new project, then Run Desktop App as Electron? That works fine here.

I would probably be able to do that with a new project now. But my problems started with this project because I tried to make an electron app with an early version of node that wasn’t compatatable to what NSB had in it’s folders. I then installed the latest version of node which didn’t work with NSB either. The only time it ran was when I installed the same version of node as the .exe file being used in NSB. It runs with all sorts of errors (includind syntax in my code acording to electron).

Although not really solved, I think I’m going to leave this topic as concluded now. I think the message is this: Before running Electron, make sure the version of node installed on your machine is the same as what’s being used within App Studio. Also if you do need to update node to match App Studio version, a later version of npm may come with the download. Don’t change the dependencies in App Studio to match the later version of npm. (Keep build version the same as well) It wasn’t all gloom though, because this app was for myself, I just used the Chrome install to make a desktop app. I have to say although it has its limitations (Browser Related) I’m really impressed as the functions and controls are very responsive and very fast. I just swapped out the App Studio desktop icon for one of my own windows desktop launcher icons and I used a pop-up window resizer from chrome extensions. Easy to send to another device to install to by just using the share page option.

Chrome install