Electron 25 “Hello World” Application using Chilkat
Demonstrate the simplest possible Electron program using Chilkat on Windows. (using Electron 25, which requires Node.js 18.17)
1. Open a GitBash shell to get a command prompt.
2. Make sure you have node 18.17
$ node -v v18.17.0
3. Create a new directory for a new application.
$ cd /c/temp $ mkdir helloWorld $ cd helloWorld
4. npm init
$ npm init -y Wrote to C:\temp\helloWorld\package.json: { "name": "helloWorld", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC" }
5. npm install electron@25.0.0
$ npm install electron@25.0.0
6. npm install @chilkat/ck-electron25-win64
$ npm install @chilkat/ck-electron25-win64
7. Create a file named main.js containing the following:
var os = require('os'); var chilkat = require('@chilkat/ck-electron25-win64'); var ftp = new chilkat.Ftp2(); console.log('Hello from Electron'); console.log(ftp.Version);
8. Edit package.json to contain the following:
{ "name": "helloWorld", "version": "1.0.0", "description": "", "main": "main.js", "scripts": { "start": "electron .", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "@chilkat/ck-electron25-win64": "^9.50.95", "electron": "^25.0.0" } }
9. Run the program.
$ npm start
admin
0
Tags :