同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Install Node.js.
Download Node.js from its official website and install it on your local PC.
You are advised to install Node.js 12.x (including npm 6.14.4) or a later version (12.13.0 or later is recommended).
Install the hpm-cli tool using npm delivered with Node.js. Run the following command:
npm install -g @ohos/hpm-cli
Run the following command to check whether the installation is successful. If an HPM version is displayed, the installation is successful.
hpm -V or hpm --version
(Optional) Run the following command to upgrade the HPM version if needed:
npm update -g @ohos/hpm-cli
After the hpm-cli tool is installed, run the following command to view HPM configurations:
hpm config
Default HPM configurations are displayed upon the command execution. You can modify the default configurations as required. The following lists common HPM configurations:
registry = https://hpm.harmonyos.com/hpm/registry/api # Configure the address of the HPM registry, mandatory for downloading bundles.
login = https://hpm.harmonyos.com/hpm/auth/pk # Configure the address for HPM login, mandatory for publishing bundles.
loginUser = {your-account} # Configure the account for HPM login, mandatory for publishing bundles.
shellPath = C:\WINDOWS\System32\cmd.exe # Configure the shell for running HPM commands.
globalRepo = C:\Users\yourname\.global # Configure the path for storing bundles that are installed globally.
http_proxy = http://your-proxy-server:port # Configure the HTTP proxy.
https_proxy = http://your-proxy-server:port # Configure the HTTPS proxy.
For details about hpm-cli commands, see HPM Commands.
For details, see Source Code Acquisition.
The HPM publishes commonly used development tools (such as those for burning, compiling, and compression) as bundles. You can run the following command to install these tools. After the command is executed, the system automatically downloads and installs the tools, which need to be installed globally only once.
hpm i -g @ohos/llvm
hpm i -g @ohos/ninja
hpm i -g @ohos/gn
hpm i -g @ohos/hc_gen
hpm i -g @ohos/sysroot
These are a set of development tools (such as gn and ninja). With these tools, you can start your general bundle development based on source code.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。