diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b1c150d0..c99046c50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,6 +134,14 @@ jobs: echo "ARKANALYZER_DIR=$(realpath $DEST_DIR)" >> $GITHUB_ENV cd $DEST_DIR + # ArkAnalyzer's bundled TypeScript (ohos-typescript 4.9.5) cannot parse + # the d.ts files of the latest floating @types/node (e.g. ffi.d.ts uses + # newer syntax and breaks `npm run build` with TS1139 etc.), so pin a + # compatible major IN THE MANIFEST before the single `npm install`. + # NB: do not run a second `npm install ` afterwards — it re-resolves + # the tree and prunes ohos-typescript, which the postinstall script adds + # with --no-save (i.e. it is absent from package.json). + npm pkg set 'devDependencies.@types/node=18' npm install npm run build