Build a native desktop timer app with Angular and Electron
- Angular v4.2
- Electron v1.7
- Angular CLI v1.4
git clone
cd angular-electron
npm install
# build the app
npm run electron-build
Learn how to bulid this Angular Electron project step-by-step.
Angular + Electron
Build a native desktop timer app with Angular and Electron
git clone
cd angular-electron
npm install
# build the app
npm run electron-build
Learn how to bulid this Angular Electron project step-by-step.
Hi Guys,
Below is my pacakge.json... when i execute and my index.html has been modfied to <base href="./">
npm run electron-build
I get the following...
{ "name": "angular-electron", "version": "0.0.0", "license": "MIT", "main": "main.js", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build --prod", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", "electron": "electron .", "electron-build": "ng build --prod && electron" }, "private": true, "dependencies": { "@angular/animations": "^5.0.0", "@angular/common": "^5.0.0", "@angular/compiler": "^5.0.0", "@angular/core": "^5.0.0", "@angular/forms": "^5.0.0", "@angular/http": "^5.0.0", "@angular/platform-browser": "^5.0.0", "@angular/platform-browser-dynamic": "^5.0.0", "@angular/router": "^5.0.0", "angular-svg-round-progressbar": "^1.2.1", "core-js": "^2.4.1", "rxjs": "^5.5.2", "zone.js": "^0.8.14" }, "devDependencies": { "@angular/cli": "1.6.3", "@angular/compiler-cli": "^5.0.0", "@angular/language-service": "^5.0.0", "@types/jasmine": "~2.5.53", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "codelyzer": "^4.0.1", "electron": "^1.7.10", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", "karma-chrome-launcher": "~2.1.1", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.1.2", "ts-node": "~3.2.0", "tslint": "~5.7.0", "typescript": "~2.4.2" } }
how do i compile the webapp as an exe file?
Following the steps, while trying to run the code into my local machine, results in error while building it.
git clone https://github.com/AngularFirebase/angular-electron.git
cd angular-electron/
npm install
npm run electron-build
The last step gives an error:
ERROR in ./src/styles.scss Module build failed: Error: Cannot find module 'node-sass' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:609:15) at Function.Module._load (internal/modules/cjs/loader.js:535:25) at Module.require (internal/modules/cjs/loader.js:663:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (/Users/miral.k/Documents/Projects/angular-electron/node_modules/sass-loader/lib/loader.js:3:14) at Module._compile (internal/modules/cjs/loader.js:734:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10) at Module.load (internal/modules/cjs/loader.js:626:32) at tryModuleLoad (internal/modules/cjs/loader.js:566:12) at Function.Module._load (internal/modules/cjs/loader.js:558:3) at Module.require (internal/modules/cjs/loader.js:663:17) at require (internal/modules/cjs/helpers.js:20:18) at loadLoader (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/loadLoader.js:13:17) at iteratePitchingLoaders (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:169:2) at iteratePitchingLoaders (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:165:10) at /Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:173:18 at loadLoader (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/loadLoader.js:36:3) at iteratePitchingLoaders (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:169:2) at iteratePitchingLoaders (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:165:10) at /Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:173:18 at loadLoader (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/loadLoader.js:36:3) at iteratePitchingLoaders (/Users/miral.k/Documents/Projects/angular-electron/node_modules/loader-runner/lib/LoaderRunner.js:169:2) @ multi ./src/styles.scss
This can be resolved by running the following command:
sudo npm install --save-dev --unsafe-perm node-sass
and then trying to build it again with npm run electron-build
will work fine.
I am using angular 10 and facing this issue
Hi, i clones the angular-electron project and run npm install, after that i am getting the error :
Metadata version mismatch for module... app.module.ts found version 3 expected 4
My package.json
{
"name": "angular-electron",
"version": "0.0.0",
"license": "MIT",
"main": "main.js",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"electron": "electron .",
"electron-build": "ng build --prod && electron ."
},
"private": true,
"dependencies": {
"@angular/animations": "^5.0.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",
"angular-svg-round-progressbar": "^1.1.0",
"bulma": "^0.5.3",
"core-js": "^2.4.1",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.4.1",
"@angular/compiler-cli": "^4.2.4",
"@angular/language-service": "^4.2.4",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "~3.1.1",
"electron": "^1.7.6",
"electron-packager": "^9.1.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.3.2",
"typescript": "~2.3.3"
}
}
Thank you very much
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.