Skip to content

Commit

Permalink
fix: respect scoped NPM_REGISTRY env var when running npm show
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Jan 18, 2024
1 parent f30d6ec commit 4557db5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,10 @@ export default class Plugins {
this.debug(`Using node executable located at: ${nodeExecutable}`)
this.debug(`Using npm executable located at: ${npmCli}`)

const registry = this.config.scopedEnvVar('NPM_REGISTRY')
const registryFlag = registry ? `--registry=${registry}` : ''
// wrap node and path in double quotes to deal with spaces
const command = `"${nodeExecutable}" "${npmCli}" show ${name} dist-tags`
const command = `"${nodeExecutable}" "${npmCli}" show ${name} dist-tags ${registryFlag}`

let npmShowResult
try {
Expand Down

0 comments on commit 4557db5

Please sign in to comment.