Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJames Chen-Smith <jameschensmith@gmail.com>2021-03-24 05:15:39 +0300
committerRuy Adorno <ruyadorno@hotmail.com>2021-03-24 17:41:28 +0300
commit543b0e39bcb94fc408804b01ca9c0d7b960b2681 (patch)
treeed2ecd9d968594d325f2f9fbcc18d4ff5755841b /lib
parent581b60b51ce0a30328fc582a4903b5d570c5d494 (diff)
fix(uninstall): use correct local prefix
Corrects non-global prefix path by using this.npm.localPrefix. A location already used throughout the repository. Later, this will be taken from the unified config library. Signed-off-by: James Chen-Smith <jameschensmith@gmail.com> PR-URL: https://github.com/npm/cli/pull/2930 Credit: @jameschensmith Close: #2930 Reviewed-by: @ruyadorno
Diffstat (limited to 'lib')
-rw-r--r--lib/uninstall.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/uninstall.js b/lib/uninstall.js
index 11e65533a..dfdd8ebd5 100644
--- a/lib/uninstall.js
+++ b/lib/uninstall.js
@@ -38,8 +38,9 @@ class Uninstall extends BaseCommand {
async uninstall (args) {
// the /path/to/node_modules/..
const global = this.npm.config.get('global')
- const prefix = this.npm.config.get('prefix')
- const path = global ? resolve(this.npm.globalDir, '..') : prefix
+ const path = global
+ ? resolve(this.npm.globalDir, '..')
+ : this.npm.localPrefix
if (!args.length) {
if (!global)