-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parallel node-gyp builds failing due to concurrent file access (Windows only) #3095
Comments
@MRayermannMSFT I think There is also a hack/workaround that uses the npm flag |
Oh nice! I had actually just implemented a workaround using |
Does this manifest as follows?
Does the EDIT: Missed the detailed logs above. I can confirm |
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.
Hi! I'm looking for help solving an issue we're starting to see more often on Windows, when
npm install
builds our native node modules.The issue is that because
npm install
runs native module builds in parallel, and each needs exclusive access to some files, they end up failing due to not being able to get that exclusive access. We believe we're seeing this issue more often because we recently standardized on usingnode-addon-api
for all five of our native modules. Thus, we have five parallel builds, all trying to access a lot of the same files. I've provided a series of example errors below (if someone wants full logs, I can provide those as well).To be clear, I don't think this is necessarialy node-gyp's fault, however it may be part of the solution. For now, I am here to see if anyone in the node-gyp community has any ideas/thoughts/suggestions on how to proceed next. So far here's some ideas I've had:
--install-strategy=nested
to de-deduplicatenode-addon-api
, thus reducing (maybe even eliminating) the chance of conflicting file access. Our project is ultimately bundled, so this will probably work out ok, but there are likely going to be other complications. Would be nice if we could only de-deduplicatenode-addon-api
.npm
to not do parallel native node module installs.node-addon-api
.--ignore-scripts
, and then usenpm rebuild
for any package which has an installScript: true in package-lock. Currently using this.--foreground-scripts
. Need to test this.The text was updated successfully, but these errors were encountered: