Ask your question and get a summary of the document by referencing this page and the AI provider of your choice
Version History
- "Add upgrade command"v9.5.823/09/2026
The content of this page was translated using an AI.
See the last version of the original content in EnglishIf you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.
GitHub link to the documentationCopy doc Markdown to clipboard
Upgrade Intlayer Packages
Copy the code to the clipboard
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 nearestpackage.jsonabove 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 examplecanary). Defaults tolatest.
What it does:
- Lists the Intlayer packages - Scans every
package.jsonof the project (skippingnode_modulesand build outputs) forintlayer,@intlayer/*,*-intlayerandintlayer-*dependencies and dev dependencies. - Fetches the target version - Reads the version of the selected dist-tag (
latestby default) of each package from the npm registry. - Rewrites the ranges - Updates each outdated range in place, keeping its operator (
^,~or none) and the file indentation. - 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:
Open the table in a modal to view all data content clearly
| Lock file | Command |
|---|---|
bun.lock / bun.lockb | bun install |
pnpm-lock.yaml | pnpm install |
yarn.lock | yarn install |
package-lock.json or no lock | npm 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:
Copy the code to the clipboard
Upgrade to the canary release:
Copy the code to the clipboard
Example output:
Copy the code to the clipboard
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.
