HarmonyOS 鸿蒙Next 【Jenkins】通过 Jenkins 执行的 ohpm install 报错
通过 Jenkins 配置打包,打包命令是: flutter build hap --target-platform ohos-arm64 --local-engine-src-path=/Users/luffy/HM/local_engine/20240126/release/src --local-engine=ohos_release_arm64 打包会报错: error! when invoke: /Users/apple/.jenkins/workspace/Harmony_OHOS/repo/flutter_cache_path/ohos/hvigorw clean --mode module -p module=flutter_cache_path
@default -p product=default assembleHar --no-daemon ,exitCode = 255. internal/modules/cjs/loader.js:983 throw err; ^ Error: Cannot find module ‘fs/promises’ Require stack: - /Users/apple/.hvigor/project_caches/0c5c2ee1487ce9301dcb27c5ad411182/workspace/node_modules/.pnpm/file+…+…+…+…+.jenkins+workspace+Harmony_OHOS+ohos+dependencies+hvigor-4.1.1.tgz/node_modules/@ohos/hvigor/src/base/util/json5-reader.js - /Users/apple/.hvigor/project_caches/0c5c2ee1487ce9301dcb27c5ad411182/workspace/node_modules/.pnpm/file+…+…+…+…+.jenkins+workspace+Harmony_OHOS+ohos+dependencies+hvigor-4.1.1.tgz/node_modules/@ohos/hvigor/src/base/util/hvigor-config-reader.js - /Users/apple/.hvigor/project_caches/0c5c2ee1487ce9301dcb27c5ad411182/workspace/node_modules/.pnpm/file+…+…+…+…+.jenkins+workspace+Harmony_OHOS+ohos+dependencies+hvigor-4.1.1.tgz/node_modules/@ohos/hvigor/src/base/internal/data/global-data.js 但是通过在打包机上终端执行是正常的 执行命令: 1. cd /Users/apple/.jenkins/workspace/Harmony_OHOS/repo/flutter_scan_code/ohos 2. hvigorw clean --mode module -p module=flutter_scan_code
@default -p product=default assembleHar 执行结果: > hvigor Finished :flutter_scan_code:default@PackageHar… after 72 ms > hvigor Finished :flutter_scan_code:assembleHar… after 1 ms > hvigor BUILD SUCCESSFUL in 10 s 461 ms ➜ ohos git:(c950582) ✗ pwd /Users/apple/.jenkins/workspace/Harmony_OHOS/repo/flutter_scan_code/ohos ➜ ohos git:(c950582) ✗ flutter build hap
更多关于HarmonyOS 鸿蒙Next 【Jenkins】通过 Jenkins 执行的 ohpm install 报错的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html