Cleans directories and files generated during ohpm installation for all modules in the project.
This command cleans the oh_modules directory, the oh-package-lock.json5 file, and the oh-package-targetName-lock.json5 file (generated during installation with the --target_path option) of all modules in the project. Upon completion, it prints the elapsed time to the console.
You can append the --kl or --keep-lockfile parameter to the ohpm clean command. This ensures that the oh-package-lock.json5 and oh-package-targetName-lock.json5 files (generated during installation with the --target_path option) are retained during the cleanup.
In ohpm 6.0.2.636 and later versions, you can append the --log_level <string> parameter to the ohpm clean command to specify the log level (info, debug, warn, or error) for execution of the current command. If this parameter is not set, the log_level setting in the .ohpmrc file is applied.
In ohpm 6.0.2.636 and later versions, you can append the --debug parameter to the command to set the log level to debug for execution of the current command. This configuration takes effect only on the current command line and does not alter the log level configured in the .ohpmrc file. If this parameter is not set, the log_level setting in the .ohpmrc file is applied.
test
|————testModule1
|————libs
|————oh-package.json5
|————build-profile.json5
|————oh-package.json5 ohpm clean
D:\test\testModule1\libs>ohpm clean ohpm DEBUG: startClean. ohpm DEBUG: clean all modules under: D:\test ohpm DEBUG: begin to clean module: D:\test\testModule1 ohpm DEBUG: begin to clean module: D:\test ohpm DEBUG: clean module: D:\test\testModule1 succeed. ohpm DEBUG: clean module: D:\test succeed. clean completed in 0s 67ms