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 ce4b116 commit 66d0e8b
Show file tree
Hide file tree
Showing 264 changed files with 15,356 additions and 6,629 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x]
node-version: ['10.1', 10.x, '12.1', 12.x, '14.1', 14.x]
script:
- 'test'
platform:
Expand Down
4 changes: 3 additions & 1 deletion lib/shrinkwrap.js
@@ -1,5 +1,7 @@
const { resolve, basename } = require('path')
const { promises: { unlink } } = require('fs')
const util = require('util')
const fs = require('fs')
const { unlink } = fs.promises || util.promisify(fs.unlink)
const Arborist = require('@npmcli/arborist')
const log = require('npmlog')

Expand Down
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
92 changes: 65 additions & 27 deletions node_modules/@npmcli/arborist/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 51 additions & 13 deletions node_modules/@npmcli/ci-detect/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 60 additions & 23 deletions node_modules/@npmcli/config/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 66d0e8b

Please sign in to comment.