From 347da770dccd365be7bc7c920cd49171f2c0fcb3 Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Tue, 7 Aug 2018 16:56:05 -0400 Subject: [PATCH] Don't use the npm binary you're about to delete --- script/config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/config.js b/script/config.js index 187114c4a..16b7cadb5 100644 --- a/script/config.js +++ b/script/config.js @@ -76,8 +76,8 @@ function getApmBinPath () { return path.join(apmRootPath, 'node_modules', 'atom-package-manager', 'bin', apmBinName) } -function getNpmBinPath () { +function getNpmBinPath (external = false) { const npmBinName = process.platform === 'win32' ? 'npm.cmd' : 'npm' const localNpmBinPath = path.resolve(repositoryRootPath, 'script', 'node_modules', '.bin', npmBinName) - return fs.existsSync(localNpmBinPath) ? localNpmBinPath : npmBinName + return !external && fs.existsSync(localNpmBinPath) ? localNpmBinPath : npmBinName }