EBUSY error while installing


(Rahul Winner) #1

What I Wanted to Do

install npm modules. I’m using command “npm Install”

What Happened Instead

We are getting following error

[exec] npm WARN tarball tarball data for @angular/compiler@7.1.0 (sha512-1Hjx6e+lVXZyXFFe4OW34ZpiaGEYyB1MQ7k2C+cMm0ABMQS3LsWT4DYhY7bk0mmMuuXQj66C62MX76ladDtdIg==) seems to be corrupted. Trying one more time.
[exec] npm WARN tarball tarball data for typescript@3.1.6 (sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA==) seems to be corrupted. Trying one more time.
[exec] npm ERR! path /data/XXxxxx/xxxx/myproject/node_modules/.staging/typescript-a7396b0c/lib/.nfs000000008ba795620000c72c
[exec] npm ERR! code EBUSY
[exec] npm ERR! errno -16
[exec] npm ERR! syscall unlink
[exec] npm ERR! EBUSY: resource busy or locked, unlink

Reproduction Steps


npm install


I’ve an Angular app. Yesterday all of sudden we have started getting tarball corrupted error on ‘npm install’. We are using npm and nodes version 6.4.1 and 8.12.0 respectively. Error is as follows.

We tried many troubleshooting steps likewise 1) npm cache clean --force 2) delete .npmrc etc, but nothing worked so far.

Can anyone please help us.

This bug looks related all of a sudden I get EPERM errors on npm install

Platform Info

$ npm --versions

$ node -p process.platform

(Lars Willighagen) #2

Note also his second report (not sure what happened there):

Both are probably duplicates of NPM produces a lot of WARN message when used over NFS, apart from the tarball warning.

(Kat Marchán) #3

Can you try removing your package-lock.json and node_modules, and trying again? Your lockfile may have gotten corrupted.

(Adam Azarchs) #4

The proximate cause of this is the way NFS handles open file handles when directories are deleted. If you have an open file handle for a directory that you then attempt to delete, nfs creates these .nfs files as placeholders because unlike a local file system it doesn’t have a way to keep the file handle alive after the directory is gone. Once the file handle is closed then directory will be removed.

So the question is what is the root cause, e.g. why does npm have open file handles in a directory it’s in the process of deleting?