Skip to content

Commit

Permalink
fix: disable msbuild.exe nodeReuse
Browse files Browse the repository at this point in the history
On windows, one may experience errors due to concurrent node-gyp calls (see nodejs#3095)

When retrying after such a failure, retries are observed to fail repeatedly with strange
EBUSY and EPERM errors. This turns out to be due to a caching feature where msbuild.exe
will continue to run in the background (for either 15s or 15m depending on VS version),
and keep open file handles to files and directories that the user may be trying to delete
(for example with a new call to `npm ci`).

This behavior is well documented, as is the recommended workaround implemented here.
  • Loading branch information
tmm1 committed Dec 29, 2024
1 parent b899fae commit 5d9beef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ async function build (gyp, argv) {
if (msvs) {
// Turn off the Microsoft logo on Windows
argv.push('/nologo')
// No lingering msbuild processes and open file handles
argv.push('/nodeReuse:false')
}

// Specify the build type, Release by default
Expand Down

0 comments on commit 5d9beef

Please sign in to comment.