Skip to content

Commit 23d53dc

Browse files
authored
🐛 Increase number of tries when unmounting (#214)
When creating a DMG with electron-installer-dmg and electron-builder, I encountered the following error due to timeout waiting for volume detach to be successful. By increasing the attempts from 5 to 8, the build is successful. The build is done using macOS Monterey (12.6) with Apple M1 Max. Maybe 10 is a better number for older Mac? at makeError (/.../node_modules/execa/index.js:174:9) at /.../node_modules/execa/index.js:278:16 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { code: 16, stdout: '', stderr: `hdiutil: couldn't unmount "disk6" - Resource busy\n`, failed: true, signal: null, cmd: 'hdiutil detach /Volumes/MyProjectName, timedOut: false, killed: false }
1 parent 35d1271 commit 23d53dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/hdiutil.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ exports.detach = function (path, cb) {
6666
let attempts = 0
6767
function attemptDetach (err) {
6868
attempts += 1
69-
if (err && (err.exitCode === 16 || err.code === 16) && attempts <= 5) {
69+
if (err && (err.exitCode === 16 || err.code === 16) && attempts <= 8) {
7070
setTimeout(function () {
7171
util.sh('hdiutil', args, attemptDetach)
7272
}, 1000 * Math.pow(2, attempts - 1))

0 commit comments

Comments
 (0)