Electron-builder: Can't build application while VSCode is open

Created on 5 Feb 2019  Â·  3Comments  Â·  Source: electron-userland/electron-builder


  • Version: 20.38.5


I'm working on an application using electron-vue, which uses electron-builder, and building the application used to work perfectly fine untill last week. When I run npm run build (which runs this script: node .electron-vue/build.js && electron-builder), the first part runs perfectly fine, but when it comes to electron-builder, it crashes during the packaging with the following error:

⨯ remove C:\Users\DE-IT\Documents\ODCEStatus\dev\build\win-unpacked\resources\app.asar: The process cannot access the file because it is being used by another process.

I tried building the exact same version I built last week (and which worked fine), and I ended up with the same error again. Also tried another, older, project which I didn't change after I finished it and that also didn't work.

What did work however, was closing Visual Studio Code.
I ran npm run build within a VSCode terminal and in GitBash (while VSCode was still running), and both times I got the same error again. However, when I completely closed VSCode, electron-builder didn't encounter any problems.

backlog

Most helpful comment

If you don't want to close VSCode for every build, adding:

{
  "files.watcherExclude": {
    "**/build/win-unpacked/**": true
  }
}

to my workspace settings fixed this problem for me.

All 3 comments

If you don't want to close VSCode for every build, adding:

{
  "files.watcherExclude": {
    "**/build/win-unpacked/**": true
  }
}

to my workspace settings fixed this problem for me.

Thank you !
Just to remember to restart VSCode after adding that line.

For those who don't know is in File->Preferences->Settings and the click the curly brackets button in top right corner

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings