jenslind / electron-gh-releases

:shipit: Electron auto-update by releasing on Github.
MIT License
225 stars 14 forks source link

TypeError: Cannot read property 'autoUpdater' of undefined at install #19

Closed manosim closed 8 years ago

manosim commented 8 years ago

Hello! When I'm trying to use updater.install() but it seems that updater is undefined. Here you can find the source code.

Details

const updater = new GhReleases(autoUpdateOptions);

updater.on('error', (event, message) => {
  console.log('ERRORED.');
  console.log('Event: ' + JSON.stringify(event) + '. MESSAGE: ' + message);
});

updater.on('update-downloaded', (info) => {
  console.log('Update downloaded');
  confirmAutoUpdate(updater.install);
});

The Error

Uncaught Exception:
TypeError: Cannot read property 'autoUpdater' of undefined
    at install (/Applications/Gitify.app/Contents/Resources/app.asar/node_modules/electron-gh-releases/GhReleases.js:197:11)
    at Function.<anonymous> (/Applications/Gitify.app/Contents/Resources/app.asar/main.js:45:9)

Screenshots

The value of updater:

screen shot 2016-06-02 at 13 44 17

The error:

screen shot 2016-06-02 at 13 44 26

Update

It looks like it is actually updating the app but it still throws that error

manosim commented 8 years ago

Looks like the problem was that I had to pass the updater object instead of the updater.install function. Works great now!