Skip to content

Commit

Permalink
[fix] node v10.0 lacks fs.promises
Browse files Browse the repository at this point in the history
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
  • Loading branch information
ljharb committed Feb 8, 2021
1 parent e815cd4 commit 6e500b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/utils/reify-finish.js
@@ -1,7 +1,9 @@
const reifyOutput = require('./reify-output.js')
const npm = require('../npm.js')
const ini = require('ini')
const {writeFile} = require('fs').promises
const util = require('util')
const fs = require('fs')
const { writeFile } = fs.promises || { writeFile: util.promisify(fs.writeFile) }
const {resolve} = require('path')

const reifyFinish = async arb => {
Expand Down

0 comments on commit 6e500b8

Please sign in to comment.