ElectronWeather Sample

Following the instructions on “Using Node and Electron to build Desktop Apps” and on running electronweather.appstudio the following appears:

“Not allowed to load local resource:…”.

Note that when deployed with F6 there is no index.html in the folder (file:///C:/NSBasic/Test/electronweather/index.html) and there are no errors in the AS logfile. Running version 7.4.2.0 in Windows 10

Also when running ‘npm init’ it would not allow capital letters in the Package Name(ElectronWeather). This had to be changed to all lower case and I changed the places in the sample app for this as well.

John

Just tried this here on a Windows 10 box. It worked fine. If you’re using the sample, there are several step which can be skipped. The Wiki article has been updated to note this:

https://wiki.appstudio.dev/Using_Node_and_Electron_to_build_Desktop_Apps

Try deleting the folder you created and starting from the beginning again.

George:

I had reinstalled at least a few times because of the upper case restriction (ie: “package name: (ElectronWeather.appstudio”) was rejected until the uppercase letters were changed. This also meant changing the Sample app references. This may be part of the problem, but probably not. The version I’m using of node.js may be newer than the one you are using and this may be something to consider. Also, my test computer for this is a Windows 10 Home fairly new laptop used only for AS and internet browsing, not Pro and again may be part of the problem.

I just deleted the Sample directory, and re-did the procedures to create an Electron app. Same results.

Question: have you tried downloading the latest version of node.js and testing this version to see of you get the same problem with uppercase? “Sorry, name can no longer contain capital letters.” when trying to use ElectronWeather.appstudio as the package name.

Thanks, John

I used Node 10.16.3 - what version are you using?

Where are you getting the upper case rejection exactly? I don’t see this message.

Run “npm init” and at the package name I cannot enter ElectronWeather.appstudio with any caps. The message appears there:

“…
Press ^C at any time to quit.
package name: (ElectronWeather.appstudio)
Sorry, name can no longer contain capital letters
version: (1.0.0)
description:
…”

If you don’t get the error we are running different versions.

John

I’m running the sample according to the directions. Since it already has a package.json file, there’s no need to do run init.

(Skip the rest of this step if you’re using the sample)

You’re right about camelcase not being allowed anymore. The sample was already updated. The documentation is now as well.

George:

I did some research on the web and found others with this same message. No good answers but I did see some mention of directory paths. So I decided to change the “Deploy local path” from the app location ( ie C:/Test/electronweather.appstudio) to a new folder (C:/Testew) and deploy there. That worked after running “npm install” and “npm start” in that folder.

John

George:

As noted previously the Win .exe runs properly but there were a number of errors when “npm run makewin” was run. See below. Let me know if something else needs to be done to remove these errors or if they can just be ignored.

Thanks, John

I get the same message here. I’m digging into it.

Looks like there have been significant changes to Electron since we released this feature. In particular, makeWinInstaller is no longer supported.

The executable is correctly made (as you noted), but not turned into an installer package. There are a number of tools available to do this, including Electron Installer and Inno Setup:

http://www.jrsoftware.org/isinfo.php

We’ll be overhauling and updating this in the next build.

I’ll wait for the next build, “electron/windows-installer” looks like a bit more than I want to dig into at this time and I’m just testing Electron for the fun of it now.

Thanks, John

Just a note: The Electron Weather example in AppStudio version 9.0 has a mistake in the package.json project property that prevents it from building.

There is an extra comma at the end of this line: electron-builder": "^23.6.0", ,

Remove the extra comma and it works fine. (Using Mac version to build .dmg file)

Thanks - we’ll fix this!

Fixed in next build - should be out in the next few days.