windows-build-tools icon indicating copy to clipboard operation
windows-build-tools copied to clipboard

Error: EBUSY: resource busy or locked

Open MAJIDNISAR opened this issue 6 years ago • 11 comments

i am trying to install the windows build tools and i am getting : npm install --global --production windows-build-tools > [email protected] postinstall C:\Users\ThunderEmperor\AppData\Roaming\npm\node_modules\windows-build-tools > node ./dist/index.js Downloading BuildTools_Full.exe [> ] 0.0% (0 B/s) Downloaded BuildTools_Full.exe. Saved to C:\Users\ThunderEmperor.windows-build-tools\BuildTools_Full.exe. Starting installation... { Error: EBUSY: resource busy or locked, unlink 'C:\Users\ThunderEmperor.windows-build-tools\build-tools-log.txt' at Object.fs.unlinkSync (fs.js:1047:3) at files.forEach (C:\Users\ThunderEmperor\AppData\Roaming\npm\node_modules\windows-build-tools\dist\utils\clean.js:13:16) at Array.forEach () at Object.cleanExistingLogFiles (C:\Users\ThunderEmperor\AppData\Roaming\npm\node_modules\windows-build-tools\dist\utils\clean.js:11:11) at Object.install (C:\Users\ThunderEmperor\AppData\Roaming\npm\node_modules\windows-build-tools\dist\install\index.js:27:13) at C:\Users\ThunderEmperor\AppData\Roaming\npm\node_modules\windows-build-tools\dist\start.js:17:19 at Promise.all.then (C:\Users\ThunderEmperor\AppData\Roaming\npm\node_modules\windows-build-tools\dist\download.js:18:21) at process._tickCallback (internal/process/next_tick.js:68:7) errno: -4082, syscall: 'unlink', code: 'EBUSY', path: 'C:\Users\ThunderEmperor\.windows-build-tools\build-tools-log.txt' } + [email protected] updated 1 package in 22.066s

MAJIDNISAR avatar Jun 05 '18 05:06 MAJIDNISAR

I ran into this too and needed to close out the window and restart my computer in order to fix this. It happens whenever you cancel the process in npm install --g --production windows-build-tools

coleherzer avatar Jun 05 '18 17:06 coleherzer

thanks i tried but it is showing me this and not proceeding any further i am stuck please help

G:\Projects\DOC.IO [dev-2 ≡]> npm install --global --production windows-build-tools > [email protected] postinstall C:\Users\ThunderEmperor\AppData\Roaming\npm\node_modules\windows-build-tools > node ./dist/index.js Downloading BuildTools_Full.exe [> ] 0.0% (0 B/s) Downloaded BuildTools_Full.exe. Saved to C:\Users\ThunderEmperor.windows-build-tools\BuildTools_Full.exe. Starting installation... Launched installers, now waiting for them to finish. This will likely take some time - please be patient! ---------- Visual Studio Build Tools ---------- [31D0:0760][2018-06-13T10:08:34]i000: MUX: Creating tree item for the static item not found i---------- Visual Studio Build Tools ---------- [2AA4:1CC0][2018-06-13T10:08:43]i371: Updating session, registration key: SOFTWARE\Microsoft--------------------- Visual Studio Build Tools ---------- [2AA4:1CC0][2018-06-13T10:08:43]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{a9528995-e130-4501-ae19-bbfaddb779cc}, resume: ARP, restart initiated: No, disable resume: No [31D0:0760][2018-06-13T10:08:43]i399: Apply complete, result: 0x0, restart: None, ba requested restart: No ------------------- Python -------------------- Python 2.7.15 is already installed, not installing again.

===================================================== image

MAJIDNISAR avatar Jun 13 '18 08:06 MAJIDNISAR

What version of node are you using?

I was running into a similar issue and eventually solved things and got the install to work properly by using a package called nvm-windows (or just nvm depending on your environment) to run the install using a more stable version of node (suggest something around v8.11.0) and everything went off without any issues.

If that doesn't seem to work I'm not really sure how to help to be honest. Best of luck

coleherzer avatar Jun 13 '18 17:06 coleherzer

In Windows 10 64-bit OS, I have resolved this issue by uninstalling Anti-Malware software.

godwin-l avatar Jun 15 '18 14:06 godwin-l

The error Error: EBUSY: resource busy or locked is most likely due to the fact that the Build Tools installer does not appear to close on its own. When you try to install the npm package a second time, the Build Tools installer still has a lock on the log file. A workaround is to end any Microsoft Visual C++ Build Tools (BuildTools_Full.exe) processes in the Task Manager.

Another workaround for a different issue you're probably experiencing is mentioned by @Philam18 in #116. I am about to submit a pull request to fix this issue.

sadegr avatar Jun 20 '18 00:06 sadegr

thankyou guys but resolved the issue of resource busy but it is stuck now on image

MAJIDNISAR avatar Jun 21 '18 10:06 MAJIDNISAR

@MAJIDNISAR, we are aware of the issue (the cause is that the Visual Studio Build Tools installer process never exits after installation) but do not have a fix at this time. It should be safe to exit the npm install process once you see successful installation messages for both Visual Studio Build Tools and Python and the All done! message (like you're seeing in your screenshot) - just press Ctrl+C to exit the process once everything is finished installing and you will be returned to a PowerShell prompt.

sadegr avatar Jun 21 '18 17:06 sadegr

Just delete all the files and repeat them again. image

wqk317 avatar Aug 17 '18 09:08 wqk317

This blocks us from installing build-tools on a VSTS agent, as we cannot restart the machine. Can we come up with another solution?

abettadapur avatar Sep 04 '18 20:09 abettadapur

I fixed mine by quitting browser_broker.exe in the task manager.

breekoy avatar Feb 26 '19 01:02 breekoy

For me, it got fixed by stopping a process called Runtime Broker in Windows task manager.

sampathBlam avatar Apr 12 '20 09:04 sampathBlam