小工具知识网

当前位置: 首页 > 行业知识 > OpenHarmony 3.2realease for 树莓派4B下拉代码并编译遇到的问题及解决方法

行业知识

OpenHarmony 3.2realease for 树莓派4B下拉代码并编译遇到的问题及解决方法

2026-11-29 18:44:34 来源:互联网转载

1、OHOS 3.2release 代码repo sync的nodejs报错,npm报错

���错如下:throw err:Error: Cannot find module 'semver'


解决方法:从官网下载nodejs替换到repo sync的安装路径下

wegt https://nodejs.org/dist/v12.18.4/node-v12.18.4-linux-x64.tar.gztar zxvf node-v12.18.4-linux-x64.tar.gz 

 2.OHOS 3.2release 执行./build/prebuilts_download.sh脚本报错

报错如下:

无法获取'../prebuilts/clang/ohos/linux-x86_64/Tivn/include'的文件状态(stat):没有那个文件或目录


解决方法:清除目标目录‘linux-x86_64’重新执行.sh文件

3.编译报错缺少相应包:

报错如下:

u-boot-tools is not installed. please install it.

 mtd-utils is not installed. please install it.

 scons is not installed. please install it.

 gcc-arm-linux-gnueabi is not installed. please install it.


解决方法:

sudo apt-get install u-boot-tools genext2fs mtd-utils scons gcc-arm-linux-gnueabi

4.编译找不到文件:

报错如下:

[OHOS ERROR] ccache: error: execv of ../../prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/bin/clang failed: No such file or directory

[OHOS ERROR] FAILED: mingw_x86_64/obj/third_party/bounds_checking_function/src/libsec_static/scanf_s.o 

[OHOS ERROR] ccache: error: execv of ../../prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/bin/clang failed: No such file or directory


参照 prebuilts_download.py脚本并查看下载路径下的下载文件,发现clang-mingw.tar.gz没有下载完整。
个人的解决方法:

1、从官网手动下载了压缩包并替换在脚本默认下载路径(../OpenHarmony_canary_prebuilts)中的原压缩包(名字不变)

2、删除安装路径下的所有文件(prebuilts/mingw-w64/ohos/linux-x86_64)

3、重新执行prebuilts_download.sh脚本

上一篇:补丁服务器怎么做?

下一篇:身份证背后的秘密,轻松掌握快速辨别性别的方法!