1

Electron Builder Error: EBUSY: Resource Busy or Locked During Packaging

I'm encountering a persistent issue while building an Electron application using Angular 14, electron-builder, and related dependencies. Despite multiple attempts at troubleshooting, the error persists. Here are the details of my setup and the errors:

Environment

  • Electron: ^21.3.0
  • Electron Builder: 24.13.3
  • Electron Packager: ^17.1.1
  • Electron Wix MSI: ^5.0.0
  • Angular: v14

Error Details

During the build process, I encounter the following errors:

Error #1 --------------------------------------------------------------------------------
Error: EBUSY: resource busy or locked, copyfile 'D:\wamp64\www\VoffiseGitExternal\voffis_desktop_apps\node_modules@ampproject\remapping\dist\remapping.mjs.map' -> 'D:\wamp64\www\VoffiseGitExternal\voffis_desktop_apps\release\win-unpacked\resources\app\node_modules@ampproject\remapping'

Error #2 --------------------------------------------------------------------------------
Error: EBUSY: resource busy or locked, copyfile 'D:\wamp64\www\VoffiseGitExternal\voffis_desktop_apps\node_modules@ampproject\remapping\dist\remapping.mjs' -> 'D:\wamp64\www\VoffiseGitExternal\voffis_desktop_apps\release\win-unpacked\resources\app\node_modules@ampproject\remapping'

Error #3 --------------------------------------------------------------------------------
Error: EBUSY: resource busy or locked, copyfile 'D:\wamp64\www\VoffiseGitExternal\voffis_desktop_apps\node_modules@ampproject\remapping\dist\remapping.umd.js.map' -> 'D:\wamp64\www\VoffiseGitExternal\voffis_desktop_apps\release\win-unpacked\resources\app\node_modules@ampproject\remapping'

Error #4 --------------------------------------------------------------------------------
Error: EBUSY: resource busy or locked, open 'D:\wamp64\www\VoffiseGitExternal\voffis_desktop_apps\release\win-unpacked\resources\app\node_modules@ampproject\remapping' failedTask=build stackTrace=Error: Cannot cleanup:

Troubleshooting Steps Taken

  1. Reinstalled node modules:

    rm -rf node_modules
    npm install
    
  2. Clean npm cache npm cache clean --force

  3. Restarted the PC to ensure no processes are holding onto the files.

  4. Closed all applications to confirm no files are in use.

Despite these efforts, the issue persists.

Additional Information

  • The errors occur during the packaging step when using electron-builder.
  • The specific file causing the issue appears to be related to @ampproject\remapping.

Has anyone encountered a similar issue or have any insights on how to resolve this? Any help would be greatly appreciated!

I tried the following steps to resolve the issue:

  1. Reinstalled node modules:

    rm -rf node_modules
    npm install
    
  • I expected this to ensure all dependencies are correctly installed and up-to-date.
  1. Cleaned npm cache: npm cache clean --force
  • I expected this to remove any potentially corrupted cache files that might be causing the issue.
  1. Restarted the PC to ensure no processes are holding onto the files.
  2. Closed all applications to confirm no files are in use.

Despite these efforts, the error persists. I was expecting these steps to resolve the file lock issue and allow the build process to complete successfully.

0