diff options
author | isaacs <i@izs.me> | 2020-11-17 04:17:25 +0300 |
---|---|---|
committer | Ruy Adorno <ruyadorno@hotmail.com> | 2020-11-17 22:38:17 +0300 |
commit | bc9afb195f5aad7c06bc96049c0f00dc8e752dee (patch) | |
tree | 57f1631b485b4f303146f3fc1ae8306c0be35862 /lib/ci.js | |
parent | 4e522fdc917bc85af2ca8ff7669a0178e2f35123 (diff) |
Preserve builtin conf when installing npm globally
When a file named 'npmrc' is in the root of the npm module that is
currently running, it adds config values that override the defaults (but
not the global or user configs).
This is a way for a system package installer to tell the npm that it
installs to put its globals somewhere other than the default. In order
to keep these configs around when users self-update npm with `npm i -g
npm`, these config values must be "sticky", and ride along into the
newly globally installed npm.
This commit restores this behavior, fixing self-updating npm for Windows
users, and any other systems that may make use of this functionality.
Fixes: #2002
PR-URL: https://github.com/npm/cli/pull/2184
Credit: @isaacs
Close: #2184
Reviewed-by: @ruyadorno
Diffstat (limited to 'lib/ci.js')
-rw-r--r-- | lib/ci.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,7 +1,7 @@ const util = require('util') const Arborist = require('@npmcli/arborist') const rimraf = util.promisify(require('rimraf')) -const reifyOutput = require('./utils/reify-output.js') +const reifyFinish = require('./utils/reify-finish.js') const log = require('npmlog') const npm = require('./npm.js') @@ -35,7 +35,7 @@ const ci = async () => { ]) // npm ci should never modify the lockfile or package.json await arb.reify({ ...npm.flatOptions, save: false }) - reifyOutput(arb) + await reifyFinish(arb) } module.exports = Object.assign(cmd, { completion, usage }) |