Queries the version update information of third-party libraries (supported since ohpm 6.1.1.830).
ohpm dependency-check [options] [<@group>/<pkg>]
You can append the --registry <registry> parameter to the ohpm dependency-check command to specify the repository address. If this parameter is not manually configured, the command will use the repository address from the configuration file.
You can append the --ft <number> or --fetch_timeout <number> parameter to the ohpm dependency-check command to set the timeout period for the query operation (unit: ms). If this parameter is not set, the timeout period is 60000 ms.
If no parameter is appended to the ohpm dependency-check command, or the --strict_ssl or --strict_ssl true parameter is appended, HTTPS certificate verification is enabled.
In ohpm 26.0.0.630 and later versions, to disable verification, append --no-strict_ssl (recommended) or --strict_ssl false to the command.
You can append the --rt <number> or --retry_times <number> parameter to the ohpm dependency-check command to set the number of retries upon a failure. If this parameter is not set, the default value 1 is used.
You can append the --ri <number> or --retry_interval <number> parameter to the ohpm dependency-check command to set the retry interval (unit: ms). If this parameter is not set, the default interval is 1000 ms.
You can append the --all or --all-modules parameter to the ohpm dependency-check command to obtain the version update information of third-party libraries in all modules (including those in the project root directory).
You can append the -m <string> or --modules<string> parameter to the ohpm dependency-check command to obtain the version update information of third-party libraries in the specified modules. string can be one or more module names separated by commas (,).
You can append the -p or --project parameter to the ohpm dependency-check command to obtain the version update information of third-party libraries in the project-level directory.
You can append the -d or --dev parameter to the ohpm dependency-check command to obtain the version update information of third-party libraries in devDependencies of the oh-package.json5 file. By default, the command obtains the update information from the dependencies field.
You can append the -j or --json parameter to the ohpm dependency-check command to output the obtained version update information in JSON format to the console and save it to the dependency-check-output.json file in the project-level directory. If this parameter is not set, the information is output in table format to the console or to the dependency-check-output.txt file.
You can append the -l or --long parameter to the ohpm dependency-check command to obtain detailed version update information of third-party libraries. If this parameter is not set, the brief version update information is obtained. For details about the detailed and brief update information, see Examples.
You can append the -c or --console parameter to the ohpm dependency-check command. By default, the obtained update information is output to the dependency-check-output.txt file in the project-level directory. With this parameter, the information is also output to the console.
Rules for querying the version update information of third-party libraries:
To obtain the detailed version update information of third-party libraries, run the following command:
ohpm dc --all -c -l
Example output:
package installed wanted latest type description dependedBy dependencyType homepage ---------------------------------------------------------------------------------------------------------------------- checkupdate_pkgc3 1.2.0 1.2.0 1.2.0 match update to date library prod http://a.c checkupdate_pkgc5 0.1.1 0.1.1 0.1.2 match update to date library prod http://a.c checkupdate_pkgc2 2.0.0 2.0.0 2.0.0 match update to date library prod http://a.c checkupdate_pkgea4 1.0.0 1.0.0 1.0.0 match update to date project prod @js-joda/core 5.5.2 5.5.2 5.6.0 match update to date project prod https://c.d test-check-update 3.8.9-beta 3.8.9-beta 4.0.0 match update to date project prod https://a.y Here are the recommended replacement packages for the following dependent packages : checkupdate_pkgea4->checkupdate_test@2.0.0-beta, third-party test library checkupdate_pkgea4->@fdddd/test@1.1.5, third-party test library @js-joda/core->checkupdate_test@2.0.0-beta, third-party test library @js-joda/core->@fdddd/test@1.1.5, third-party test library test-check-update->checkupdate_test@2.0.0, third-party test library Here is the security update information: 2 package container 2 vulnerabilities,2 malwares checkupdate_pkgea4@1.0.0, CVE-xxxx-xxxx test, cross-site scripting (XSS) vulnerability, checkupdate_pkgea4@1.0.0, asfasdf test-check-update@3.8.9-beta, CVE-xxxx-xxxxx test, XSS vulnerability test-check-update@3.8.9-beta, virusxxx
To obtain the brief version update information of third-party libraries, run the following command:
ohpm dc --all -c
Example output:
package installed wanted latest type dependedBy ---------------------------------------------------------------------------- checkupdate_pkgc3 1.2.0 1.2.0 1.2.0 match library checkupdate_pkgc5 0.1.1 0.1.1 0.1.2 match library checkupdate_pkgc2 2.0.0 2.0.0 2.0.0 match library checkupdate_pkgea4 1.0.0 1.0.0 1.0.0 match project @js-joda/core 5.5.2 5.5.2 5.6.0 match project test-check-update 3.8.9-beta 3.8.9-beta 4.0.0 match project Here are the recommended replacement packages for the following dependent packages : checkupdate_pkgea4->checkupdate_test@2.0.0-beta, third-party test library checkupdate_pkgea4->@fdddd/test@1.1.5, third-party test library @js-joda/core->checkupdate_test@2.0.0-beta, third-party test library @js-joda/core->@fdddd/test@1.1.5, third-party test library test-check-update->checkupdate_test@2.0.0, third-party test library Here is the security update information: 2 package container 2 vulnerabilities,2 malwares checkupdate_pkgea4@1.0.0, CVE-xxxx-xxxx test, XSS vulnerability, checkupdate_pkgea4@1.0.0, asfasdf test-check-update@3.8.9-beta, CVE-xxxx-xxxxx test, XSS vulnerability test-check-update@3.8.9-beta, virusxxx