Skip to content

Commit

Permalink
fix: write the registry address to workspace projects' npmrc files
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Dec 8, 2023
1 parent fb66c2c commit d71bbe9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,13 @@ export async function applyPackageOverrides(
'utf-8',
)

// While `--registry` works for the `install` command,
// we still need to persist the registry in `.npmrc` for any possible
// subsequent commands that needs to connect to the registry.
writeOrAppendNpmrc(dir, `registry=${REGISTRY_ADDRESS}\n`)

// use of `ni` command here could cause lockfile violation errors so fall back to native commands that avoid these
if (pm === 'pnpm') {
// FIXME: write/append to npmrc instead
await $`pnpm install --no-frozen-lockfile --no-strict-peer-dependencies --registry ${REGISTRY_ADDRESS}`
} else if (pm === 'yarn') {
await $`yarn install --registry ${REGISTRY_ADDRESS}`
Expand Down

0 comments on commit d71bbe9

Please sign in to comment.