From d49bbcd3466a51ad79a2838a7cd221048d134acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Sat, 15 Apr 2017 12:35:37 -0700 Subject: [PATCH] fix(fix-owner): throw away ENOENTs on chownr This is a race npm has run into before. I am not sure how to reproduce such a thing with cacache, but tbh if a directory or file disappears mid-chown, I could care less? Furthermore, if the file/directory's existence actually matters, this will almost certainly error elsewhere. It's fine for us to drop files on the floor though. --- lib/util/fix-owner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/fix-owner.js b/lib/util/fix-owner.js index c7b1300..7000bff 100644 --- a/lib/util/fix-owner.js +++ b/lib/util/fix-owner.js @@ -27,7 +27,7 @@ function fixOwner (filepath, uid, gid) { filepath, typeof uid === 'number' ? uid : process.getuid(), typeof gid === 'number' ? gid : process.getgid() - ) + ).catch({code: 'ENOENT'}, () => null) ) }