Skip to content

fix(node): remove unpublished NAPI targets from package manifest#348

Merged
DorianZheng merged 1 commit intoboxlite-ai:mainfrom
Bl3f:fix/remove-unpublished-napi-targets
Mar 6, 2026
Merged

fix(node): remove unpublished NAPI targets from package manifest#348
DorianZheng merged 1 commit intoboxlite-ai:mainfrom
Bl3f:fix/remove-unpublished-napi-targets

Conversation

@Bl3f
Copy link
Copy Markdown
Contributor

@Bl3f Bl3f commented Mar 5, 2026

Problem

(fixes #347)

@boxlite-ai/[email protected] on npm declares four optionalDependencies (generated by napi prepublish from napi.targets):

  • @boxlite-ai/boxlite-darwin-arm64published
  • @boxlite-ai/boxlite-darwin-x64404
  • @boxlite-ai/boxlite-linux-x64-gnupublished
  • @boxlite-ai/boxlite-linux-arm64-gnu404
$ npm view @boxlite-ai/[email protected]
npm error 404 Not Found - GET https://registry.npmjs.org/@boxlite-ai%2fboxlite-linux-arm64-gnu - Not found

Root cause

sdks/node/package.json declares 4 NAPI targets, but .github/workflows/config.yml only builds 2 platforms (darwin-arm64 and linux-x64-gnu). The napi prepublish step in prepack injects optionalDependencies for all 4 targets regardless of which platform packages are actually built and published.

Fix

Remove x86_64-apple-darwin and aarch64-unknown-linux-gnu from napi.targets since they aren't built by CI. They can be re-added when the corresponding platforms are supported and built:

  • x86_64-apple-darwin (macOS Intel) — listed as "Coming soon" in the README
  • aarch64-unknown-linux-gnu (Linux ARM64) — listed as "Supported" but not built in CI yet

This ensures the published package only declares optional dependencies that actually exist on npm.

I also suppose another solution could to build it in the CI tho.

The napi.targets list included x86_64-apple-darwin and
aarch64-unknown-linux-gnu, but CI only builds darwin-arm64 and
linux-x64-gnu. napi prepublish generates optionalDependencies for all
declared targets, so the published @boxlite-ai/[email protected] package
references two platform packages that were never published to npm:

  - @boxlite-ai/boxlite-darwin-x64 (404)
  - @boxlite-ai/boxlite-linux-arm64-gnu (404)

This breaks npm ci in cross-platform builds (e.g. Docker) because npm
cannot create a complete lockfile when optional dependencies don't exist
on the registry.

Remove the two targets that aren't built by CI. They can be re-added
when the corresponding platforms are supported and built.

Made-with: Cursor
@DorianZheng DorianZheng merged commit b2127a9 into boxlite-ai:main Mar 6, 2026
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.

boxlite-linux-arm64-gnu and boxlite-darwin-x64 not published to npm (breaks npm ci in Docker)

2 participants