fix: remove sharp dependency that was never needed (#1141)

Sharp was an explicit dependency but nothing in the codebase imports it.
Chroma embeddings use ONNX Runtime via @chroma-core/default-embed, not sharp.
Sharp's native binary has a persistent Bun node_modules layout bug where
@img/sharp-libvips-* isn't placed alongside @img/sharp-darwin-* causing
ERR_DLOPEN_FAILED on every install.

- Remove sharp, @img/sharp-libvips-darwin-arm64, node-gyp from deps
- Remove node-addon-api from devDeps
- Remove @img cache clearing hacks from smart-install.js and sync-marketplace.cjs
- Replace with simple `bun pm cache rm` before install as general cache hygiene

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2026-02-16 19:20:34 -05:00
committed by GitHub
parent 8039ada222
commit f1162ed4a4
3 changed files with 15 additions and 27 deletions
+6 -16
View File
@@ -80,22 +80,12 @@ try {
{ stdio: 'inherit' }
);
// Remove stale lockfiles before install — they pin old native dep versions
const { unlinkSync, rmSync } = require('fs');
for (const lockfile of ['package-lock.json', 'bun.lock']) {
const lockpath = path.join(INSTALLED_PATH, lockfile);
if (existsSync(lockpath)) {
unlinkSync(lockpath);
console.log(`Removed stale ${lockfile}`);
}
}
// Clear stale native module cache (sharp/libvips) — Bun's cache can retain
// native binaries that reference companion libraries at broken relative paths
const bunCacheImgDir = path.join(os.homedir(), '.bun', 'install', 'cache', '@img');
if (existsSync(bunCacheImgDir)) {
rmSync(bunCacheImgDir, { recursive: true, force: true });
console.log('Cleared stale native module cache (@img/sharp)');
// Clear Bun's package cache to prevent stale native module artifacts
try {
execSync('bun pm cache rm', { cwd: INSTALLED_PATH, stdio: 'pipe' });
console.log('Cleared Bun package cache');
} catch {
// Cache may not exist yet on first install
}
console.log('Running bun install in marketplace...');