Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

npm Error : EBUSY resource busy or locked #13461

Closed
scagulanna opened this issue Jul 22, 2016 · 34 comments
Closed

npm Error : EBUSY resource busy or locked #13461

scagulanna opened this issue Jul 22, 2016 · 34 comments

Comments

@scagulanna
Copy link

scagulanna commented Jul 22, 2016

I am new to angulr and each time i try to run the npm install to install packages in package.json, i get the following error

C:\Users\Chinedu>cd plans
The system cannot find the path specified.

C:\Users\Chinedu>cd desktop

C:\Users\Chinedu\Desktop>
C:\Users\Chinedu\Desktop>cd plans

C:\Users\Chinedu\Desktop\Plans>cd angular2

C:\Users\Chinedu\Desktop\Plans\Angular2>cd angular2-quickstart

C:\Users\Chinedu\Desktop\Plans\Angular2\angular2-quickstart>npm install
npm WARN retry will retry, error on last attempt: Error: EBUSY: resource busy or
 locked, rename 'C:\Users\Chinedu\AppData\Local\Temp\npm-7276-2a3723d9\registry.
npmjs.org\_40angular\upgrade\-\upgrade-2.0.0-rc.4.tgz.3208765519' -> 'C:\Users\C
hinedu\AppData\Local\Temp\npm-7276-2a3723d9\registry.npmjs.org\_40angular\upgrad
e\-\upgrade-2.0.0-rc.4.tgz'
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Chinedu\\AppData
\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.7
npm ERR! npm  v3.10.5

npm ERR! tarball.destroy is not a function
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm WARN retry will retry, error on last attempt: Error: EBUSY: resource busy or
 locked, rename 'C:\Users\Chinedu\AppData\Local\Temp\npm-7276-2a3723d9\registry.
npmjs.org\_40angular\http\-\http-2.0.0-rc.4.tgz.3495958710' -> 'C:\Users\Chinedu
\AppData\Local\Temp\npm-7276-2a3723d9\registry.npmjs.org\_40angular\http\-\http-
2.0.0-rc.4.tgz'
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Chinedu\\AppData
\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.7
npm ERR! npm  v3.10.5

npm ERR! tarball.destroy is not a function
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm WARN retry will retry, error on last attempt: Error: EBUSY: resource busy or
 locked, rename 'C:\Users\Chinedu\AppData\Local\Temp\npm-7276-2a3723d9\registry.
npmjs.org\_40angular\upgrade\-\upgrade-2.0.0-rc.4.tgz.3192006008' -> 'C:\Users\C
hinedu\AppData\Local\Temp\npm-7276-2a3723d9\registry.npmjs.org\_40angular\upgrad
e\-\upgrade-2.0.0-rc.4.tgz'
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Chinedu\\AppData
\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.7
npm ERR! npm  v3.10.5

npm ERR! tarball.destroy is not a function
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm WARN retry will retry, error on last attempt: Error: EBUSY: resource busy or
 locked, rename 'C:\Users\Chinedu\AppData\Local\Temp\npm-7276-2a3723d9\registry.
npmjs.org\_40angular\http\-\http-2.0.0-rc.4.tgz.3801615371' -> 'C:\Users\Chinedu
\AppData\Local\Temp\npm-7276-2a3723d9\registry.npmjs.org\_40angular\http\-\http-
2.0.0-rc.4.tgz'
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Chinedu\\AppData
\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.7
npm ERR! npm  v3.10.5

npm ERR! tarball.destroy is not a function
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

Please any idea how to resolve this. It always happens each time i use the npm install tool, i always get the resource locked or busy error message

@ernanirst
Copy link

Hello @scagulanna I found myself with the same issue on windows 10. At first I tried to delete the directory indicated, for you that would be C:\Users\Chinedu\AppData\Local\Temp\npm-7276-2a3723d9\. But when I ran npm again, it would throw the same error on another similar path.

So what worked for me was deleting all directories on C:\Users\Chinedu\AppData\Local\Temp\ that start with npm-.

Hope this works for you too.

@othiym23
Copy link
Contributor

npm WARN retry will retry, error on last attempt: Error: EBUSY: resource busy or locked, rename 'C:\Users\Chinedu\AppData\Local\Temp\npm-7276-2a3723d9\registry.npmjs.org\_40angular\upgrade\-\upgrade-2.0.0-rc.4.tgz.3208765519' -> 'C:\Users\Chinedu\AppData\Local\Temp\npm-7276-2a3723d9\registry.npmjs.org\_40angular\upgrade\-\upgrade-2.0.0-rc.4.tgz'

Closing as a duplicate of #8564. The issue with tarball.destroy not being set has also been addressed in recent versions of npm@3, at least, so do give upgrading npm a try if you run into this problem.

@joel61
Copy link

joel61 commented Oct 29, 2016

The problem was got solved by running the same command with "Run as Administrator" in command prompt.

@yashpalpuri
Copy link

I resolved with npm cache clean

@shahidkarimi
Copy link

shahidkarimi commented Feb 21, 2017

This issue is still unresolved.

@karthiksundar
Copy link

karthiksundar commented Feb 26, 2017

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

@sana4591
Copy link

sana4591 commented Mar 6, 2017

@karthiksundar , uninstalling Anti-Malware solved the issue on my behalf, million thanks.

@kennyedward
Copy link

Running the command prompt as an admin solved this issue for me

@mahrizal
Copy link

@karthiksundar it works for me
Thanks a lot

@chaitanyachekuri
Copy link

@karthiksundar Thanks, A Lot. Stupid Malware. Good for nothing

@Jimit09
Copy link

Jimit09 commented Jun 16, 2017

Thanks a lot!! Uninstalling the Malware worked for me too.

@ElTimuro
Copy link

ElTimuro commented Jul 10, 2017

Solved by deactivating Antivir :)

@shingenko
Copy link

Wanted to add a comment. I was running into this issue. I didn't have any antivirus running. What I did have though was saving the file into a Dropbox folder. Dropbox sync service appears to have been locking up the file. I killed dropbox, then npm install worked just fine. Restarted Dropbox again once my npm config was how I wanted it.

@vinaypdgr8
Copy link

Node Latest Current Version: v8.1.4 (includes npm 5.0.3) from www.nodejs.org worked for me

@mrshyi
Copy link

mrshyi commented Jul 28, 2017

The problem was got solved by running the same command again.
But I want to look for a better way.

@randre70
Copy link

randre70 commented Aug 2, 2017

npm is failing on me for one and the same package.json (attached, log file attached) for the last 3 hours.
I'm on:

Windows 10 Professional 64 Bit
node -v: 7.10.0
npm -v : 4.6.1

I tried "npm cache clean", run as administrator, deleting node_modules, ... but it keeps failing with:

npm ERR! path D:\GIT\cms-global\cms.global\src\cms.global.wpl.web.home\assets\node_modules.staging\has-flag-1c1a2c46\package.json.1212840727
npm ERR! code EBUSY
npm ERR! errno -4082
npm ERR! syscall rename
npm ERR! EBUSY: resource busy or locked, rename 'D:\GIT\cms-global\cms.global\src\cms.global.wpl.web.home\assets\node_modules.staging\has-flag-1c1a2c46\package.json.1212840727' -> 'D:\GIT\cms-global\cms.global\src\cms.global.wpl.web.home\assets\node_modules.staging\has-flag-1c1a2c46\package.json'

Afterwards the node_modules folder is always empty.
Please advise ... or where can I try to implement a "try, catch, wait and retry three times kind of behavior "?

package.json.txt
2017-08-02T15_15_35_001Z-debug.log.txt

Same applies to LTS version (v6.11.2 with npm 3.10.10) (fresh install, deleted all directories, ...).
See second log file: npm-debug.log.txt
Latest console output: console-output.txt

@wufeng87
Copy link

wufeng87 commented Aug 8, 2017

Solved by unchecking some read only of derectory properties.

@pkitatta
Copy link

Thanks a lot @karthiksundar. The most annoying thing is that the bloody anti-malware installed its self!

@mihirkadam
Copy link

It is caused by the anti-malware software. disabled the anti-malware software and try again.
https://stackoverflow.com/questions/36835882/npm-err-tarball-destroy-is-not-a-function#

@cyber2024
Copy link

I find that this happens when gulp fails to transpile, leaving a nodejs process running in the background.
End this task and you can start the bastard back up.

@Darren80
Copy link

Disable your Dropbox.

@Skura23
Copy link

Skura23 commented Jan 20, 2018

Thanks @karthiksundar. I stopped the anti-malware and the problem is solved.

@Nikhilkapoor20
Copy link

Tried with disabling byte fence anti malware in my system and it worked
steps : go to task manager
look for byte fence anti malware and click on end process

Here you go!

@saber13812002
Copy link

after disabling the antivirus also worked for me !!!!

@Phanindra34
Copy link

Im my case I build the project where the dist folder didn't build properly.
just deleted all the local temp files and Dist folder reopened my IDE (VC) the then build my code. its worked perfectly

@ngmartinezs
Copy link

Hi in my case, the issue was resolved by inactivating the antivirus

@RyanQuey
Copy link

RyanQuey commented Mar 24, 2018

In my case restarting my computer was what solved it for me :)

I'm not sure what in particular it did, but maybe there was some process going that needed to get killed. Either way, even after deleting the dist folder and trying again, nothing solved it for me except restarting

@venkat0289
Copy link

I did quit the byte fence in my windows 10 machine. Now it is working fine.

@shabith
Copy link

shabith commented Apr 24, 2018

disabling real-time protection in windows defender fixed this issue.

@Brendan-Bormann
Copy link

I ran into this same issue, however, I seemed to solve mine with an npm update and that seemed to allow me to install it.

@jmaicaaan
Copy link

I solved mine by doing these things

  • disable windows defender (optional)
  • npm update
  • running this command in Administration npm --add-python-to-path='true' --debug install --global windows-build-tools

Btw, i'm using a windows 10 machine. I'm not sure if disabling windows defender really helps but yeah I now can't reproduce the issue. Hope this helps everyone!

@bodduuec
Copy link

@karthiksundar, Thanks a lot...it worked after uninstalling anti malware software.

@venkatprabu5
Copy link

Resolved after uninstall anti malware also do npm cache clean

@GaoQianhui1991
Copy link

I closed the Visual Studio 2017 and the Visual Studio Code,then open cmd to run command,the problem got solved

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests