Skip to content

fix(cicd): use npm ci so TW v4 oxide native binary resolves on Linux#152

Merged
programad merged 1 commit into
developfrom
fix/cicd-tw-v4-npm-ci
May 8, 2026
Merged

fix(cicd): use npm ci so TW v4 oxide native binary resolves on Linux#152
programad merged 1 commit into
developfrom
fix/cicd-tw-v4-npm-ci

Conversation

@programad
Copy link
Copy Markdown
Contributor

Summary

Unblocks the v0.5.0 release pipeline. The prepare-release run for #151 failed at Run tests with:

@rocketicons/tailwind: Cannot find native binding. npm has a bug related to optional dependencies (npm/cli#4828)

Root cause

@rocketicons/tailwind's integration test loads @tailwindcss/postcss, which dynamically loads @tailwindcss/oxide, which in turn loads a per-platform native binary (@tailwindcss/oxide-linux-x64-gnu on the runner) declared as optionalDependencies.

Two factors compound:

  1. actions/cache for node_modules uses restore-keys: Linux-node- — so even when the exact dependency-hash key misses, it restores an older Linux cache (from before TW v4 was added) that has no oxide-linux binary.
  2. The workflow then runs npm install (not npm ci). With a partial-but-non-empty node_modules already in place, npm install does NOT detect that the Linux platform variant of an optional dep is missing — that's npm/cli#4828.

Result: tests fail at module-load with Cannot find native binding.

Fix

Replace npm installnpm ci in prepare-release.yml. npm ci:

  • always wipes node_modules first (so partial restored caches don't poison the install)
  • installs strictly from package-lock.json (which already records all platform variants — verified)
  • correctly fetches the per-platform optional binaries for the runner OS

Verified locally with npm ci --dry-run — lockfile is in sync, no errors.

Why minimal

Only changes one line + comment. Same node_modules cache layer, same actions/cache@v4 setup, same dependency-hash key. No workflow restructuring.

Test plan

CI for the v0.5.0 prepare-release was failing in `Run tests` because
@rocketicons/tailwind's integration test (`packages/tailwind/src/index.test.ts`)
loads `@tailwindcss/postcss`, which loads `@tailwindcss/oxide`, which
loads a per-platform native binary (`@tailwindcss/oxide-linux-x64-gnu`
on the runner) declared as an optional dependency.

`actions/cache` was restoring node_modules from a pre-TW-v4 cache via
`restore-keys`, then `npm install` ran but didn't add the missing Linux
variant — known npm bug npm/cli#4828. `npm ci` wipes node_modules and
installs strictly from the lockfile (which already lists all platform
variants), so the right binary lands every time.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@programad programad merged commit 9dccd2d into develop May 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant