Skip to content

Incorrect replacement suggested for devtools::update_packages() without arguments #2709

Open

Description

@jzadra

Incorrect replacement suggested for devtools::update_packages() without arguments

Description

As of devtools 2.5.0, calling devtools::update_packages() without arguments produces the warning:

`update_packages()` was deprecated in devtools 2.5.0.
Please use `pak::pak()` instead.

However, pak::pak() without arguments is not a drop-in replacement for devtools::update_packages().

Reproducible example

devtools::update_packages()
# Warning: Please use `pak::pak()` instead.

pak::pak()
# Error: error in pak subprocess
# Caused by error in `find_package_root(path = root)`:
# Could not find R package in `.` or its parent directories.

The suggested replacement requires a package project in the current directory or its parent directories, whereas the original function could be called without specifying a package.

Expected behavior

The deprecation warning should provide a working replacement for the no-argument invocation or explain that there is no direct equivalent.

The migration guide currently documents:

update_packages("pkg") -> pak::pak("pkg")

However, it does not address the no-argument invocation.

Suggested improvement

Please update the deprecation warning and migration documentation to distinguish between:

  • Updating a specified package.
  • Updating installed packages without specifying a package.
  • Installing or updating dependencies of the current package project.

If pak does not provide an equivalent for the no-argument invocation, the warning should state this explicitly and recommend an appropriate alternative, such as utils::update.packages() where applicable.

Why this matters

Following the deprecation warning verbatim results in an error in a context where the original function worked.

Deprecation warnings should provide actionable migration guidance, particularly when the recommended replacement has different default behavior.

Activity

  1. changed the title [-]Incorrect replacement suggested by update_packages() deprecation warning[/-] [+]Incorrect replacement suggested for devtools::update_packages() without arguments[/+] on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions