The package doesn't seem to work with Angular 6
Closed this issue ยท 9 comments
I was trying to build an electron-angular application. After installing the package via npm, adding it to dependencies, and then importing it in app.module.ts, here is the error I am getting:
ERROR in node_modules/ngx-electron/src/electronService.d.ts(1,27): error TS2307: Cannot find module 'electron'. node_modules/ngx-electron/src/electronService.d.ts(16,23): error TS2503: Cannot find namespace 'NodeJS'.
Not sure what to do now.
Hi @shailesh1729, we've encountered the "Cannot find namespace 'NodeJS'" as well, and we fixed it by adding "types": ["node"] in our tsconfig.app.json as explained here : https://github.com/TypeStrong/typedoc/issues/320.
We didn't have the other issue with electron, but we hope this helps !
@shailesh1729 I fixed this by adding "electron" to my project.
npm install electron --save-dev
Hope this helps!
- Created new Angular 6 project using Angular cli.
- npm install electron --save-dev
- npm install ngx-electron --save
- Imported ngx-electron inside app module
- launching this._electronService.shell.openExternal('https://google.com') inside app.component.ts
currently working on a re-write for latest Angular..
should be out by the end of the week.
any news? I can't upgrade to angular 7
I installed electron with --save-dev option, I imported ngx-electron correctly but it does not work with ng serve. I mean, if I build the angular 6 app, and run electron . it works well, but while I am developing the app and I don't want to compile the app to see the result it does not work. remote and almost every property in the service is set to null. Is it normal?
should be fixed with the most recent release 2.0.0
need add BrowserModule with NgxElectronModule in imports
Not sure I understand why we have to include the 'electron' package inside our WebApp in order to be packaged in... Electron... For me, it has been resolved only by adding the electron types to the dev dependencies.: npm install -D @types/electron