Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/next/src/lib/helpers/get-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ import { getFormattedNodeOptionsWithoutInspect } from '../../server/lib/utils'
* @default https://registry.npmjs.org/
*/
export function getRegistry(baseDir: string = process.cwd()) {
const pkgManager = getPkgManager(baseDir)
let pkgManager = getPkgManager(baseDir)

// Starting from pnpm v10.7.1, pnpm fallbacks to npm for registry config.
// This works in most cases, unless the project is a workspace because the flag below is needed.
// Setting `pkgManager` to `npm` to ensure the command works as expected.
if (pkgManager === 'pnpm') {
pkgManager = 'npm'
}

// Since `npm config` command fails in npm workspace to prevent workspace config conflicts,
// add `--no-workspaces` flag to run under the context of the root project only.
// Safe for non-workspace projects as it's equivalent to default `--workspaces=false`.
Expand Down
Loading