Install Command

The install command facilitates the installation of packages in the PxPlus Package Manager. It allows users to specify the exact package, version, or range of versions they wish to install.

Synopsis

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

Description

The install command provides flexibility in package installation. Users can install specific versions, the latest version, a range of versions based on semantic versioning, or multiple packages at once. If the command is run without any arguments, it will install all packages listed in the packages.json file.

Parameters

  • packageauthor/packagename: The full name of the package you wish to install, formatted as packageauthor/packagename.
  • semantic_version: A version or version range. Examples include:
    • A specific 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 indicates any version in the 2.x.x range)

For a comprehensive understanding of semantic versioning, refer to the official semantic versioning documentation.

Examples

  • To install a specific package version:

    install johnsmith/[email protected]
  • To install the latest version of a package:

    install johnsmith/mypackage

    or

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

    install johnsmith/[email protected] janedoe/anotherpackage@^2.0
  • To install all packages from packages.json:

    install

Output

If the installation is successful, the system will notify the user that the desired package(s) has/have been installed. If there's an issue, a relevant error message will be displayed.

Exceptions

  • If a specified package cannot be found, the system will throw a PackageNotFoundException.
  • If there's a version mismatch or an invalid semantic version, the system will throw a VersionMismatchException.

See Also

For further understanding and nuances of the PxPlus Package Manager commands, refer to the documentation or use the help command.