question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auto-update fails with ENOENT: no such file or directory, rename

See original GitHub issue
  • Version: electron-builder@20.38.3 electron-updater@4.0.6

  • Target: macOS 10.14.2

We’re seeing an error after the update is downloaded. This error is different from others open issues because it’s on rename, not chmod.

Error: ENOENT: no such file or directory, rename '/Users/username/Library/Application Support/Caches/tesla-updater/pending/temp-Command E-1.2.22-mac.zip' -> '/Users/username/Library/Application Support/Caches/tesla-updater/pending/Command E-1.2.22-mac.zip'

Our flow: The user hits a keyboard shortcut, we run autoUpdater.checkForUpdates();. Note: the user may hit they keyboard shortcut a lot of times (triggering parallel downloads?) The download starts. The download finishes, and we call autoUpdater.quitAndInstall();:

  autoUpdater.on('update-downloaded', (updateInfo) => {
    log.info(`autoUpdater - Version ${updateInfo.version} downloaded, notify, quitting, installing, and relaunching`);

    const notification = new Notification({
      title: `Restarting Command E`,
      body: `Updating to version ${updateInfo.version}`,
    });
    notification.show();

    setTimeout(() => {
      log.info(`autoUpdater - Quitting and installing now`);
      autoUpdater.quitAndInstall();
    }, 3000);
  });

Here’s the full error:

image

Any ideas? Thanks for the work you put into this amazing library.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
sanzog03commented, Jan 27, 2020

when you use both autoUpdater.autoDownload = true; and

autoUpdater.on("update-available", info => {
 autoUpdater.downloadUpdate();
});

in same code, both code tries to dowload the updates. Hence, a conflict arises when trying to install and quit the app.

so, set autoUpdater.autoDownload = false; and everything will work as it’s supposed to.

3reactions
TheFeelTraincommented, Jan 30, 2019

I am having this same issue in my application on both Windows and Linux as well.

Error: ENOENT: no such file or directory, chmod ‘/home/thefeeltrain/.cache/soonlauncher-updater/pending/temp-soonlauncher-4.4.1.AppImage’

This is also a copy of #3526

Read more comments on GitHub >

github_iconTop Results From Across the Web

NPM: ENOENT: no such file or directory, rename
When I got this error I looked for all running instances of node in my task manager (i use process explorer ...
Read more >
How to fix: npm ERR! enoent ENOENT: no such file or ...
I recently struggled for a while with an npm error thrown when executing npm install of some package. The error message was npm...
Read more >
Cordova force update on stuck clients due hash mismatch
... [autoupdate] Download failure: failed at injecting isDesktop and writing to disk: ENOENT: no such file or directory, ...
Read more >
Auto Update - electron-builder
Auto update relies only on the first provider in the list (you can specify several publishers). Thus, probably, there`s no need to upload...
Read more >
VSTS Hosted agent (Windows) automatic agent update ...
How can I revert this change and prevent such automatic-updates going forward, ... ":"Failed find: ENOENT: no such file or directory, stat 'D:\\a\\1\\s\\CM....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found