3

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.

asked Jun 5, 2024 at 17:00

1 Answer 1

0

Create a .easignore file in the root of your project. Code:

# Visual Studio files
.vs/
*.vsidx
*.suo
*.user
*.userosscache
*.sln.docstates
# IDE files
.vscode/
.idea/
# OS files
.DS_Store
Thumbs.db
# Temporary files
*.tmp
*.temp
# Node modules (already ignored by default, but just in case)
node_modules/
# Build outputs
dist/
build/
answered Sep 23, 2025 at 20:22
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.