Import Electron in a Angular 2 project with Typescript and SystemJS


Hi guys,

I have created a project with the angular2 cli. In my main.ts I would to import electron like that:

import { electron } from 'electron'

This is not working. I have checked and usually we import using electron using require. Angular 2 using SystemJS I would like to import electron that way.

Can someone explain me why this is not working and how can I get through this?

Thanks :slight_smile:


I have the same question.


Could someone find the solution?


Hi all.

I’m currently using electron-forge thats gives a template for angular2

npm install -g electron-forge
# Initialize a new project
$ electron-forge init my-new-project --template=angular2
# Launch your app
$ cd my-new-project
$ electron-forge start

It seems to work ok. It don’t use cli but I don’t know if it’s neccesary.


Here Angular Typescript Electron with systemjs solution: