Error Message
No Match.
Symptom
No matching version is found.
Possible Causes
The package version obtained from the server does not match the version configured in oh-package.json5.
Solution
Check the available versions of the package and ensure that the specified version exists. Update the ohpm version in oh-package.json5 accordingly.
Error Message
Install Pkg To Local Failed.
Symptom
Failed to install the local HAR package.
Possible Causes
Solution
Error Message
Install Local Hsp Failed.
Symptom
Failed to install the local HSP.
Possible Causes
Solution
Generate a new TGZ package using DevEco Studio and compare it to identify missing information in the local HSP.
Error Message
Not Found Hsp File By Registry Tgz.
Symptom
The .hsp file is not found.
Possible Causes
The .hsp file cannot be found in the HSP.
Solution
Check the HSP and ensure that the .hsp file is included.
Error Message
Invalid CliInput Pkg.
Symptom
The dependency package name is invalid.
Possible Causes
The dependency package name cannot be retrieved from the central or private repository.
Solution
Search for the package name in the central or private repository to ensure it is correct.
Error Message
Inconsistent Dep Names.
Symptom
The package names declared in the dependencies do not match the actual package names.
Possible Causes
With useNormalizedOHMUrl (in the project-level build-profile.json5 file) or enforce_dependency_key (in the .ohpmrc file) set to true, ohpm checks whether the names of the configured local dependencies match their corresponding package names. A mismatch results in command execution failure.
Solution
Check the dependency list and ensure that the package name in each dependency matches the actual package name.
Error Message
Field IS Empty Error.
Symptom
A mandatory field is empty.
Possible Causes
A mandatory field in oh-package.json5 is not set.
Solution
Check the mandatory fields in oh-package.json5 and ensure that they contain valid values.
Error Message
Internal Program Error.
Symptom
The latest dependency version is not found.
Possible Causes
With multiple available dependency versions, ohpm fails to identify the latest version.
Solution
Check the package dependencies to ensure that there are no conflicts or incompatibilities. For details, see Dependency Version Conflicts of a Module.
Error Message
File Not Found.
Symptom
The file does not exist.
Possible Causes
The oh-package.json5 file does not exist in the directory.
Solution
Ensure that the oh-package.json5 file exists in the directory.
Error Message
Hook Fail.
Symptom
Failed to execute the hook command.
Possible Causes
The hook command returned a non-zero exit code, or the configured command is invalid or unavailable. For example, if oh-package.json5 contains "hooks": { "postInstall": "echo 'Installation complete' && exit 1" }, exit 1 causes ohpm install to treat the hook as failed.
Solution
Ensure that the hooks command is correct.
Error Message
Target Path UnExist Error.
Symptom
The path specified in the command does not exist.
Possible Causes
The --target_path option is used, but the specified path does not exist or is incorrect.
Solution
Check the command line to ensure that the target path exists and is correct. For details, see target_path.
Error Message
Option Specified Parameter File Not Found.
Symptom
The parameter file pointed to by the path specified in parameterFile does not exist.
Possible Causes
The path specified by parameterFile does not exist or points to a nonexistent file.
Solution
Ensure that the path configured in parameterFile is correct and points to an existing file.
Error Message
Invalid Group Option.
Symptom
The package name is invalid.
Possible Causes
The package name does not start with a lowercase letter (a to z), exceeds 36 characters in length, or contains characters other than lowercase letters (a to z), digits (0 to 9), hyphens (-), and underscores (_).
Solution
Check the package name and ensure it meets the requirements.