diff --git a/script/config.js b/script/config.js index 16b7cadb5..e56f43e79 100644 --- a/script/config.js +++ b/script/config.js @@ -77,6 +77,8 @@ 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, 'script', 'node_modules', '.bin', npmBinName) return !external && fs.existsSync(localNpmBinPath) ? localNpmBinPath : npmBinName diff --git a/script/vsts/platforms/macos.yml b/script/vsts/platforms/macos.yml index d3df65a2b..0ea324633 100644 --- a/script/vsts/platforms/macos.yml +++ b/script/vsts/platforms/macos.yml @@ -19,11 +19,12 @@ jobs: - script: npm install --global npm@6.2.0 displayName: Update npm - - script: export PATH="/usr/local/bin:${PATH}" && script/bootstrap + - script: script/bootstrap displayName: Bootstrap build environment env: CI: true CI_PROVIDER: VSTS + NPM_BIN_PATH: /usr/local/bin/npm - script: script/lint displayName: Run linter