Closed gavinaiken closed 5 years ago
Using the sync version of fs.mkdir
resolves the issue, although this is maybe not the best approach:
diff --git a/github.js b/github.js
index a4ae063..1a80deb 100644
--- a/github.js
+++ b/github.js
@@ -585,9 +585,7 @@ GithubLocation.prototype = {
.on('finish', function() {
return clearDir(tmpDir)
.then(function() {
- return asp(fs.mkdir(tmpDir));
- })
- .then(function() {
+ fs.mkdirSync(tmpDir);
return new Promise(function(resolve, reject) {
var files = [];
yauzl.open(tmpFile, function(err, zipFile) {
Or using the experimental fs.promises
api is another possibility:
diff --git a/github.js-orig b/github.js
index a4ae063..6a26c15 100644
--- a/github.js-orig
+++ b/github.js
@@ -585,6 +585,9 @@ GithubLocation.prototype = {
.on('finish', function() {
return clearDir(tmpDir)
.then(function() {
+ if (fs.promises) {
+ return fs.promises.mkdir(tmpDir);
+ }
return asp(fs.mkdir(tmpDir));
})
.then(function() {
or of course bluebird promisify, or manually wrapping fs.mkdir
with a promise, or other solutions!
Happy to put up a PR if any of those approaches sounds good.
I've updated jspm-github - this should be working now! Please let me know if you're still seeing it after upgrading.
Thanks, that fixed it!
A node deprecation https://nodejs.org/api/deprecations.html#deprecations_dep0013_fs_asynchronous_function_without_callback has become an error in node v10 and causes a jspm install of bootstrap to fail.
env:
steps to reproduce (some command output removed for brevity):
Doing the same thing with node v8.11.3 succeeds: