这是indexloc提供的服务,不要输入任何密码
Skip to content

[turborepo] Update codemod doesn't support custom registries and fails if NPM registry is unavailable #4152

@denexapp

Description

@denexapp

What version of Turborepo are you using?

1.8.1

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Windows

Describe the Bug

I have an outdated version 1.8.1 of turborepo. When I run turbo commands, it shows me a message to run a codemod to update. However, when I run the codemod to update turborepo it fails. It shows "Unable to fetch the latest version of turbo" error message.

NPM registry is banned by our corporate firewall, and we use a proxy registry. In this scenario the codemod doesn't work.

The reason why it happens is because the registry url is hardcoded in the codemod: https://github.com/vercel/turbo/blob/main/packages/turbo-codemod/src/commands/migrate/steps/getLatestVersion.ts#LL5

Expected Behavior

It should use the same registry as the package manager and shouldn't rely on availability of NPM registry.

To Reproduce

To reproduce this issue, configure your package manager to use custom registry, ban npm registry on a network level and run pnpm dlx @turbo/codemod update.

Reproduction Repo

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions