Skip to content

Commit 15728ba

Browse files
authored
Fix ci-ets: pin @types/node@18 for the ArkAnalyzer build (#362)
* Fix ci-ets: pin @types/node@18 for the ArkAnalyzer build ArkAnalyzer's npm install pulls the floating latest @types/node, whose new d.ts files (e.g. ffi.d.ts) use syntax that ArkAnalyzer's bundled TypeScript cannot parse, so `npm run build` fails with TS1139/TS1005 errors and the whole ci-ets job dies before any Gradle test runs. Pin a compatible @types/node major right after npm install. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix ci-ets: pin @types/node in the manifest instead of a second npm install A follow-up `npm install --no-save @types/node@18` re-resolves the npm tree and prunes ohos-typescript, which ArkAnalyzer's postinstall script installs with --no-save (it is absent from package.json), so the build fails with TS2307. Pin @types/node via `npm pkg set` BEFORE the single `npm install` instead: the pin then survives resolution and postinstall keeps ohos-typescript in place. Verified locally: `npm run build` produces out/src/save/serializeArkIR.js.
1 parent dfb9993 commit 15728ba

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ jobs:
134134
echo "ARKANALYZER_DIR=$(realpath $DEST_DIR)" >> $GITHUB_ENV
135135
cd $DEST_DIR
136136
137+
# ArkAnalyzer's bundled TypeScript (ohos-typescript 4.9.5) cannot parse
138+
# the d.ts files of the latest floating @types/node (e.g. ffi.d.ts uses
139+
# newer syntax and breaks `npm run build` with TS1139 etc.), so pin a
140+
# compatible major IN THE MANIFEST before the single `npm install`.
141+
# NB: do not run a second `npm install <pkg>` afterwards — it re-resolves
142+
# the tree and prunes ohos-typescript, which the postinstall script adds
143+
# with --no-save (i.e. it is absent from package.json).
144+
npm pkg set 'devDependencies.@types/node=18'
137145
npm install
138146
npm run build
139147

0 commit comments

Comments
 (0)