Skip to content

Commit 5d9beef

Browse files
committed
fix: disable msbuild.exe nodeReuse
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.
1 parent b899fae commit 5d9beef

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/build.js

+2
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ async function build (gyp, argv) {
141141
if (msvs) {
142142
// Turn off the Microsoft logo on Windows
143143
argv.push('/nologo')
144+
// No lingering msbuild processes and open file handles
145+
argv.push('/nodeReuse:false')
144146
}
145147

146148
// Specify the build type, Release by default

0 commit comments

Comments
 (0)