小编Jov*_*van的帖子

如何在electron.js中修复“由于应用程序未打包而跳过checkForUpdatesAndNotify”

我正在使用“ electron-updater”来检查自动更新Electron应用程序。

调用“ checkForUpdatesAndNotify()”函数。

在控制台中,我收到“因为应用程序未打包,所以跳过checkForUpdatesAndNotify”。

  • mac0S Mojave,
  • “ electron-updater”:“ ^ 4.0.6”,
  • “ electron”:“ ^ 3.0.13”,
  • “电子生成器”:“ 20.28.1”

        const {autoUpdater} = require("electron-updater");
        autoUpdater.checkForUpdatesAndNotify();
    
        autoUpdater.on('checking-for-update', () => {
          console.log('Checking for update...');
        });
    
        autoUpdater.on('update-available', (info) => {
          console.log('Update available.');
        });
    
        autoUpdater.on('update-not-available', (info) => {
          console.log('Update not available.');
        });
    
        autoUpdater.on('error', (err) => {
          console.log('Error in auto-updater. ' + err);
        });
    
        autoUpdater.on('download-progress', (progressObj) => {
          let log_message = "Download speed: " + progressObj.bytesPerSecond;
          log_message = log_message + ' - Downloaded ' + progressObj.percent + '%'; …
    Run Code Online (Sandbox Code Playgroud)

auto-update electron electron-builder

6
推荐指数
1
解决办法
554
查看次数

标签 统计

auto-update ×1

electron ×1

electron-builder ×1