Instead of files randomly requiring the npm singleton,
we pass it where it needs to go so that tests don't need
to do so much require mocking everywhere
PR-URL: https://github.com/npm/cli/pull/2772
Credit: @wraithgar
Close: #2772
Reviewed-by: @ruyadorno
In this node version, fall back to `util.promisify` of the callback version.
Maybe fixes https://github.com/npm/cli/issues/2623. Maybe fixes https://github.com/npm/cli/issues/2652. Maybe fixes https://github.com/npm/cli/issues/2625.
PR-URL: https://github.com/npm/cli/pull/2654
Credit: @ljharb
Close: #2654
Reviewed-by: @wraithgar, @ruyadorno