Update Command

The update command is used within the PxPlus Package Manager to update installed packages. It enables users to either update a specific package to its latest version or update all packages.

Synopsis

update [packageauthor/packagename]@[semantic_version]
  • packageauthor/packagename: (Optional) The package's full name, which includes both the author's name and the package name.
  • @semantic_version: (Optional) The semantic version or version range to update to. If omitted, the latest version will be fetched.

Description

The update command offers a dynamic way to keep packages up-to-date. Users have the flexibility to update to specific versions, the latest version, or even multiple packages simultaneously. Running the command without any parameters will update all packages to the versions specified in the packages.json file or their latest versions if not specified.

Parameters

  • packageauthor/packagename: The full designation of the package you aim to update, presented as packageauthor/packagename.
  • semantic_version: A version or version range. Examples encompass:
    • A distinct version (e.g., 1.0.0)
    • The wildcard (*) for the latest version
    • The caret (^) followed by a version for the latest minor or patch (e.g., ^2.1.0 implies any version within the 2.x.x range)

To fully grasp semantic versioning, please consult the official semantic versioning documentation.

Examples

  • To update a particular package to a specific version:

    update johnsmith/[email protected]
  • To update a package to its most recent version:

    update johnsmith/mypackage

    or

    update johnsmith/mypackage@*
  • To update multiple packages:

    update johnsmith/[email protected] janedoe/anotherpackage@^2.0
  • To update all packages according to packages.json:

    update

Output

If the update process is successful, the system will notify the user that the specified package(s) has/have been updated. In case of an issue, an appropriate error message will be showcased.

Exceptions

  • When a given package is not found, the system will raise a PackageNotFoundException.
  • If there's a version mismatch or an invalid semantic version is provided, a VersionMismatchException will be generated.
  • Should there be any version conflicts after an attempted update, the system will return a VersionConflictException.

See Also

For a deeper understanding and nuances of the PxPlus Package Manager commands, delve into the primary documentation or utilize the help command.