diff --git a/script/config.js b/script/config.js index 67d522e558f..4fb052b4928 100644 --- a/script/config.js +++ b/script/config.js @@ -3,7 +3,6 @@ 'use strict'; -const fs = require('fs'); const path = require('path'); const spawnSync = require('./lib/spawn-sync'); @@ -113,8 +112,6 @@ function getApmBinPath() { } function getNpmBinPath(external = false) { - if (process.env.NPM_BIN_PATH) return process.env.NPM_BIN_PATH; - const npmBinName = process.platform === 'win32' ? 'npm.cmd' : 'npm'; const localNpmBinPath = path.resolve( repositoryRootPath, @@ -123,7 +120,5 @@ function getNpmBinPath(external = false) { '.bin', npmBinName ); - return !external && fs.existsSync(localNpmBinPath) - ? localNpmBinPath - : npmBinName; + return localNpmBinPath; } diff --git a/script/lib/install-script-dependencies.js b/script/lib/install-script-dependencies.js index bb026b35a35..11a01cd8675 100644 --- a/script/lib/install-script-dependencies.js +++ b/script/lib/install-script-dependencies.js @@ -9,8 +9,9 @@ process.env.ELECTRON_CUSTOM_VERSION = CONFIG.appMetadata.electronVersion; module.exports = function(ci) { console.log('Installing script dependencies'); + const npmBinName = process.platform === 'win32' ? 'npm.cmd' : 'npm'; childProcess.execFileSync( - CONFIG.getNpmBinPath(ci), + npmBinName, ['--loglevel=error', ci ? 'ci' : 'install'], { env: process.env, cwd: CONFIG.scriptRootPath } ); diff --git a/script/lib/verify-machine-requirements.js b/script/lib/verify-machine-requirements.js index 8b8420aac14..afac015d513 100644 --- a/script/lib/verify-machine-requirements.js +++ b/script/lib/verify-machine-requirements.js @@ -3,11 +3,8 @@ const childProcess = require('child_process'); const path = require('path'); -const CONFIG = require('../config'); - module.exports = function(ci) { verifyNode(); - verifyNpm(ci); verifyPython(); }; @@ -24,24 +21,6 @@ function verifyNode() { } } -function verifyNpm(ci) { - const stdout = childProcess.execFileSync( - CONFIG.getNpmBinPath(ci), - ['--version'], - { env: process.env } - ); - const fullVersion = stdout.toString().trim(); - const majorVersion = fullVersion.split('.')[0]; - const oldestMajorVersionSupported = ci ? 6 : 3; - if (majorVersion >= oldestMajorVersionSupported) { - console.log(`Npm:\tv${fullVersion}`); - } else { - throw new Error( - `npm v${oldestMajorVersionSupported}+ is required to build Atom. npm v${fullVersion} was detected.` - ); - } -} - function verifyPython() { // This function essentially re-implements node-gyp's "find-python.js" library, // but in a synchronous, bootstrap-script-friendly way.