Can't open file dialog using Electron and Angular


#1

I cannot figure out how to show the open file dialog from Electron.

When I use the provided example I get an error:

Error: Cannot find module 'electron' from '/Users/michaelcalkins/Code/codesketcher/assets/js'

I’m using browserify to build the app anything I try just generates errors.

Gulpfile contents:

var elixir = require('laravel-elixir')
elixir.config.assetsPath = 'assets'

elixir(function(mix) {
    mix.sass('app.scss', 'dist/css')
       .browserify('app.js', 'dist/js')
})

#2

To my understanding, one of the reasons for Electron is so that you don’t need browserify? What’s wrong with using dialog.showOpenDialog from the Electron API?


#3

Turns out I was doing it totally wrong not understanding the what was node and what was front end. Works once I treated it like a server.