Author:
    Creation:2026-09-23Last update:2026-09-23

    Upgrade Intlayer Packages

    bash
    npx intlayer upgrade
    

    The upgrade command lists the Intlayer packages declared in every package.json of your project, including monorepo workspaces, and upgrades them to the latest published version. It runs the same package upgrade step as intlayer init, on its own.

    Arguments:

    • --project-root [projectRoot] - Optional. The project root directory. By default, the command starts from the nearest package.json above the current working directory.
    • --dry-run - Optional. Lists the packages and their target version without modifying any file.
    • --tag <tag> - Optional. The npm dist-tag to upgrade to (for example canary). Defaults to latest.

    What it does:

    1. Lists the Intlayer packages - Scans every package.json of the project (skipping node_modules and build outputs) for intlayer, @intlayer/*, *-intlayer and intlayer-* dependencies and dev dependencies.
    2. Fetches the target version - Reads the version of the selected dist-tag (latest by default) of each package from the npm registry.
    3. Rewrites the ranges - Updates each outdated range in place, keeping its operator (^, ~ or none) and the file indentation.
    4. Installs once - Runs a single install from the workspace root (the nearest directory with a lock file), using the package manager that owns the lock file:
    Lock fileCommand
    bun.lock / bun.lockbbun install
    pnpm-lock.yamlpnpm install
    yarn.lockyarn install
    package-lock.json or no locknpm install

    If there is no lock file, the packageManager field of package.json (for example "bun@1.2.0") is used before falling back to npm.

    Ranges that do not point to the registry, such as workspace:*, file:, link:, catalog: or git URLs, are never modified.

    Examples:

    List the available upgrades without applying them:

    bash
    npx intlayer upgrade --dry-run
    

    Upgrade to the canary release:

    bash
    npx intlayer upgrade --tag canary
    

    Example output:

    bash
    npx intlayer upgrade
    Intlayer packages:
      package.json
        intlayer ^9.0.0 ^9.5.7
      apps/web/package.json
        next-intlayer ^9.5.7 (latest)
        vite-intlayer ~9.2.0 ~9.5.7
    Running bun install...
     Upgraded 2 Intlayer dependencies to latest
    

    Notes:

    • Run the command from the root of your repository to upgrade every workspace. Run it from a workspace to upgrade that workspace only.
    • Packages whose version cannot be fetched (offline, private or unpublished package) are listed and left unchanged.
    • If the install fails, the upgraded ranges are kept in package.json. Run your package manager's install command manually.