summaryrefslogtreecommitdiff
path: root/deps/npm/lib/ci.js
diff options
context:
space:
mode:
authorclaudiahdz <cghr1990@gmail.com>2019-09-03 17:51:04 -0500
committerRich Trott <rtrott@gmail.com>2019-09-17 18:51:21 -0700
commit17e420b23f5462db9f1951d98233fdaee889c721 (patch)
treec0f855138f734517aeba81000ebeac9d6e271563 /deps/npm/lib/ci.js
parent7fa03b54c88f930d24f2f0e2ceb0e94dc5a6ad77 (diff)
downloadnode-new-17e420b23f5462db9f1951d98233fdaee889c721.tar.gz
deps: update npm to 6.11.3
PR-URL: https://github.com/nodejs/node/pull/29430 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'deps/npm/lib/ci.js')
-rw-r--r--deps/npm/lib/ci.js34
1 files changed, 30 insertions, 4 deletions
diff --git a/deps/npm/lib/ci.js b/deps/npm/lib/ci.js
index 1fbb28b570..309ad2f784 100644
--- a/deps/npm/lib/ci.js
+++ b/deps/npm/lib/ci.js
@@ -1,8 +1,9 @@
'use strict'
+const npm = require('./npm.js')
const Installer = require('libcipm')
-const npmConfig = require('./config/figgy-config.js')
-const npmlog = require('npmlog')
+const log = require('npmlog')
+const path = require('path')
ci.usage = 'npm ci'
@@ -10,8 +11,33 @@ ci.completion = (cb) => cb(null, [])
module.exports = ci
function ci (args, cb) {
- return new Installer(npmConfig({ log: npmlog })).run().then(details => {
- npmlog.disableProgress()
+ const opts = {
+ // Add some non-npm-config opts by hand.
+ cache: path.join(npm.config.get('cache'), '_cacache'),
+ // NOTE: npm has some magic logic around color distinct from the config
+ // value, so we have to override it here
+ color: !!npm.color,
+ hashAlgorithm: 'sha1',
+ includeDeprecated: false,
+ log,
+ 'npm-session': npm.session,
+ 'project-scope': npm.projectScope,
+ refer: npm.referer,
+ dmode: npm.modes.exec,
+ fmode: npm.modes.file,
+ umask: npm.modes.umask,
+ npmVersion: npm.version,
+ tmp: npm.tmp
+ }
+
+ for (const key in npm.config.list[0]) {
+ if (key !== 'log') {
+ opts[key] = npm.config.list[0][key]
+ }
+ }
+
+ return new Installer(opts).run().then(details => {
+ log.disableProgress()
console.log(`added ${details.pkgCount} packages in ${
details.runTime / 1000
}s`)