Repository navigation
feat(cli): download Node.js for the expo APNs key setup when it is missing - #1997
Merged
ArnabChatterjee20k merged 2 commits intoOct 9, 2026
Conversation
The expo setup stopped when node or npm was missing, or node was older than 18. It now downloads the Node.js LTS (v24.21.0) for this OS and CPU from nodejs.org into the setup's session folder, checks the archive against the SHA-256 pinned for each official build, unpacks it beside its final folder and moves it into place, and runs npm through node. Nothing is installed system-wide, and later runs reuse it. Entries that would unpack outside the folder are refused and symbolic links (npm's shell wrappers) are skipped. A node set on the adapter is checked but never replaced.
🟢 Tier S · Ready to mergeAdds a pinned, checksum-verified Node.js runtime download for Expo APNs key setup when no usable Node.js is available. The runtime is unpacked in a staging directory, reused across runs, and covered by build-selection, download, extraction, and concurrency tests. The CLI generator includes the new runtime implementation and tests in generated CLI output. Latest changes: The new commits avoid removing an already-published runtime during concurrent setup and add a test exercising concurrent first-time downloads.
📂 Walkthrough · 4
✅ Fixed since the last review · 1
Reviewed the commits since |
Two expo setups starting together in the same session folder could both download Node.js, and the later one removed the runtime the earlier one had just published, maybe while it was running npm or the helper. Publishing is now only a rename: an existing runtime is never removed, and when another run published first, its complete runtime is used.
ArnabChatterjee20k
merged commit Oct 9, 2026
89ea7ee
into
messaging-provider-cli-apns
54 of 61 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1963. With this,
--provider expono longer requires Node.js to be installed.What
Before, the expo APNs key setup stopped with "needs Node.js 18 or later" when
nodeornpmwas missing, ornodewas too old. Now it downloads Node.js itself and carries on:The download only happens for
--provider expo(orAPPWRITE_APNS_SETUP=expo) on a machine without a usable Node.js. The defaultappwritesetup needs no runtime.How
nodeset on the adapter is checked and never replaced.nodeandnpmfrom PATH, if node is 18 or later.darwin/linuxx64/arm64.tar.gz,winx64/arm64.zip) comes fromhttps://nodejs.org/dist/v24.21.0/.runtime.go, taken from the release'sSHASUMS256.txt. A download that doesn't match is deleted and nothing is unpacked...) are refused.node .../npm/bin/npm-cli.js ci …, so its wrappers aren't needed. The downloadedbinfolder goes first onPATHfor npm and the helper.<session folder>/runtime/node-v24.21.0-<os>-<arch>/, which is~/.appwrite/apns/expo/runtime/from the CLI. Nothing is installed system-wide, and later runs reuse it. Without a session folder it goes into a temporary folder that's removed afterwards.apns.ErrUnavailablewith the reason, before anything is sent to Apple.Tests
TestNodeBuild: build name and archive type for each OS/arch, a pinned checksum for each, and no build for unsupported platforms.TestCreateKeyDownloadsNodeWhenMissing: with nothing butmkdiron PATH, it downloads a fake build (a shell-scriptnode) from a local server, unpacks it, runsnpm ciand the helper through it, and creates the key. A second run reuses it with no second download.nodestays executable and npm's symbolic link isn't unpacked.TestDownloadNodeRejectsABadChecksum: a mismatched checksum fails, and nothing is unpacked.TestUntarRefusesPathsOutsideTheFolder:../evilis refused and not written.node --versionprintedv24.21.0andnpm-cli.js --versionprinted11.19.0.-race), gofmt, the WebAssembly browser build,GOOS=windows go vetfor the apns packages, Rector and the Generation suite all pass.Notes
SHASUMS256.txtwasn't verified, becausegpgwasn't available when they were pinned. A maintainer withgpgcan check them against https://nodejs.org/dist/v24.21.0/SHASUMS256.txt.sig.nodeReleaseand the six checksums.