{"record":{"id":"cdf7f6d00dc54a72","repo":"coreybutler/nvm-windows","slug":"error-failed-to-copy-update-exe-v","errorCode":null,"errorMessage":"error: failed to copy update.exe: %v\n","messagePattern":"error: failed to copy update\\.exe: (.+?)\n","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/upgrade/upgrade.go","lineNumber":508,"sourceCode":"\t\terr = nvmtestcmd.Run()\n\t\tif err != nil {\n\t\t\tstatus <- Status{Err: err}\n\t\t}\n\t}\n\n\t// Debugging\n\tif verbose {\n\t\ttree(currentPath, \"final directory contents:\")\n\t}\n\n\t// Hide the update directory\n\tsetHidden(filepath.Join(currentPath, \".update\"))\n\n\t// If an \"update.exe\" exists, run it\n\tif fsutil.IsExecutable(filepath.Join(tmp, \"assets\", \"update.exe\")) {\n\t\terr = copyFile(filepath.Join(tmp, \"assets\", \"update.exe\"), filepath.Join(currentPath, \".update\", \"update.exe\"))\n\t\tif err != nil {\n\t\t\tstatus <- Status{Err: fmt.Errorf(\"error: failed to copy update.exe: %v\\n\", err)}\n\t\t\tos.Exit(1)\n\t\t}\n\t}\n\n\tautoupdate(status)\n\n\treturn nil\n}\n\ntype Status struct {\n\tText   string\n\tErr    error\n\tDone   bool\n\tHelp   bool\n\tCancel bool\n\tWarn   string\n}\n","sourceCodeStart":490,"sourceCodeEnd":526,"githubUrl":"https://github.com/coreybutler/nvm-windows/blob/5b18223ca19ff50d707f35410dbc6bd440a9f74d/src/upgrade/upgrade.go#L490-L526","documentation":"After the new files are copied into the install directory, nvm-windows copies update.exe from the extracted assets into the hidden .update subfolder so post-update steps can run it. This error means that copyFile failed — almost always because the source update.exe does not exist at that moment (asset download failed earlier, error 44) or the .update directory could not be written. It is followed by os.Exit(1), a hard abort.","triggerScenarios":"update.exe was never downloaded (asset download error was sent to status but the flow continued); .update directory creation (os.MkdirAll earlier) failed silently since its error is ignored; target file locked by a previous nvm process still holding .update/update.exe; permissions on NVM_HOME.","commonSituations":"Upgrade flow continuing after an earlier per-asset download failure because the loop does not abort; leftover update.exe running from a prior interrupted upgrade; non-admin install into a protected directory.","solutions":["Re-run the upgrade ensuring the update.exe asset downloads correctly (fix any network/proxy issue from the earlier asset error).","Kill any lingering update.exe / nvm.exe processes in Task Manager before upgrading.","Run the upgrade as Administrator so .update under NVM_HOME is writable.","If NVM_HOME/.update is corrupt, delete it manually and retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Confirm update.exe arrived before the copy step\nif _, err := os.Stat(filepath.Join(tmp, \"assets\", \"update.exe\")); err != nil {\n    return fmt.Errorf(\"update.exe missing from downloaded assets; aborting before os.Exit path\")\n}","typeGuard":null,"tryCatchPattern":"This path ends in os.Exit(1) — catch upstream by validating the file exists first, since after Exit no cleanup (deferred RemoveAll) runs.","preventionTips":["Abort the upgrade when any earlier asset download fails instead of continuing.","Kill stale update.exe processes from prior upgrades.","Run elevated so .update is writable."],"tags":["filesystem","upgrade","update-exe","windows"],"backgroundTag":null,"analyzedSha":"5b18223ca19ff50d707f35410dbc6bd440a9f74d","analyzedAt":"2026-08-15T10:06:51.428Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}