diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2016-11-04 01:54:24 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2016-11-04 05:18:08 +0300 |
commit | afda66d9afcdcbae1d148f589287583c4182d124 (patch) | |
tree | 6c769cffe6c3906ee4f72a02bb754cd5ba354fd9 /node_modules/graceful-fs | |
parent | a52d0f0c9cf2de5caef77e12eabd7dca9e89b49c (diff) |
graceful-fs@4.1.10
Better backoff for EPERM on Windows.
Credit: @sam-github
Fixes: #12059
Reviewed-By: @othiym23
Reviewed-By: @isaacs
PR-URL: https://github.com/isaacs/node-graceful-fs/pull/97
Diffstat (limited to 'node_modules/graceful-fs')
-rw-r--r-- | node_modules/graceful-fs/package.json | 42 | ||||
-rw-r--r-- | node_modules/graceful-fs/polyfills.js | 18 |
2 files changed, 36 insertions, 24 deletions
diff --git a/node_modules/graceful-fs/package.json b/node_modules/graceful-fs/package.json index c072f891e..7be4e0c4e 100644 --- a/node_modules/graceful-fs/package.json +++ b/node_modules/graceful-fs/package.json @@ -2,25 +2,25 @@ "_args": [ [ { - "raw": "graceful-fs@4.1.9", + "raw": "graceful-fs@^4.1.10", "scope": null, "escapedName": "graceful-fs", "name": "graceful-fs", - "rawSpec": "4.1.9", - "spec": "4.1.9", - "type": "version" + "rawSpec": "^4.1.10", + "spec": ">=4.1.10 <5.0.0", + "type": "range" }, - "/Users/rebecca/code/npm" + "/Users/ogd/Documents/projects/npm/npm" ] ], - "_from": "graceful-fs@4.1.9", - "_id": "graceful-fs@4.1.9", + "_from": "graceful-fs@>=4.1.10 <5.0.0", + "_id": "graceful-fs@4.1.10", "_inCache": true, "_location": "/graceful-fs", "_nodeVersion": "6.5.0", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/graceful-fs-4.1.9.tgz_1475103672016_0.7011275647673756" + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/graceful-fs-4.1.10.tgz_1478127353765_0.5264726441819221" }, "_npmUser": { "name": "isaacs", @@ -29,13 +29,13 @@ "_npmVersion": "3.10.7", "_phantomChildren": {}, "_requested": { - "raw": "graceful-fs@4.1.9", + "raw": "graceful-fs@^4.1.10", "scope": null, "escapedName": "graceful-fs", "name": "graceful-fs", - "rawSpec": "4.1.9", - "spec": "4.1.9", - "type": "version" + "rawSpec": "^4.1.10", + "spec": ">=4.1.10 <5.0.0", + "type": "range" }, "_requiredBy": [ "#USER", @@ -55,11 +55,11 @@ "/tacks", "/write-file-atomic" ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.9.tgz", - "_shasum": "baacba37d19d11f9d146d3578bc99958c3787e29", + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.10.tgz", + "_shasum": "f2d720c22092f743228775c75e3612632501f131", "_shrinkwrap": null, - "_spec": "graceful-fs@4.1.9", - "_where": "/Users/rebecca/code/npm", + "_spec": "graceful-fs@^4.1.10", + "_where": "/Users/ogd/Documents/projects/npm/npm", "bugs": { "url": "https://github.com/isaacs/node-graceful-fs/issues" }, @@ -74,8 +74,8 @@ "test": "test" }, "dist": { - "shasum": "baacba37d19d11f9d146d3578bc99958c3787e29", - "tarball": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.9.tgz" + "shasum": "f2d720c22092f743228775c75e3612632501f131", + "tarball": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.10.tgz" }, "engines": { "node": ">=0.4.0" @@ -86,7 +86,7 @@ "legacy-streams.js", "polyfills.js" ], - "gitHead": "0798db3711e33de92de5a93979278bb89d629143", + "gitHead": "db8df443122686696293d47f11c227d53cab90f0", "homepage": "https://github.com/isaacs/node-graceful-fs#readme", "keywords": [ "fs", @@ -122,5 +122,5 @@ "scripts": { "test": "node test.js | tap -" }, - "version": "4.1.9" + "version": "4.1.10" } diff --git a/node_modules/graceful-fs/polyfills.js b/node_modules/graceful-fs/polyfills.js index cf474df73..ab6b32b67 100644 --- a/node_modules/graceful-fs/polyfills.js +++ b/node_modules/graceful-fs/polyfills.js @@ -80,15 +80,27 @@ function patch (fs) { // on Windows, A/V software can lock the directory, causing this // to fail with an EACCES or EPERM if the directory contains newly - // created files. Try again on failure, for up to 1 second. + // created files. Try again on failure, for up to 60 seconds. + + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. if (process.platform === "win32") { fs.rename = (function (fs$rename) { return function (from, to, cb) { var start = Date.now() + var backoff = 0; fs$rename(from, to, function CB (er) { if (er && (er.code === "EACCES" || er.code === "EPERM") - && Date.now() - start < 1000) { - return fs$rename(from, to, CB) + && Date.now() - start < 60000) { + setTimeout(function() { + fs$rename(from, to, CB); + }, backoff) + if (backoff < 100) + backoff += 10; + return; } if (cb) cb(er) }) |