sharp fails to load: missing trustedDependencies in package.json
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 74/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- bun
- 領域
- tooling
調査の方向性
plugins/macrodata/package.json を開いて依存関係の設定を確認し、その後 Bun の trustedDependencies の動作を読みます。プラグインで bun install を実行し、報告された環境で search_memory ツールが正常に読み込まれるよう、sharp のネイティブバイナリが利用可能であることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Problem
search_memory (and any tool that triggers @xenova/transformers → sharp) fails with:
Cannot find module '../build/Release/sharp-darwin-arm64v8.node'
from '/Users/.../.bun/install/cache/sharp@0.32.6@@@1/lib/sharp.js'
This happens because sharp@0.32.6 has a postinstall script that compiles/downloads the native binary, but bun skips postinstall scripts by default unless the package is listed in trustedDependencies.
Since macrodata uses bun as its runtime and package manager, the native binary is never built, and sharp fails at runtime.
Fix
Add trustedDependencies to plugins/macrodata/package.json:
"trustedDependencies": [
"sharp"
]
Then bun install will run sharp's install script and the native binary will be available.
Workaround
Until this is fixed upstream, users can manually patch their cached copy:
# Find the cached plugin
cd ~/.claude/plugins/cache/macrodata/macrodata/<version>/
# Add trustedDependencies to package.json (before devDependencies)
# "trustedDependencies": ["sharp"]
# Reinstall
rm -rf node_modules/sharp
bun install
# May also need to copy the binary to bun's global cache:
mkdir -p ~/.bun/install/cache/sharp@0.32.6@@@1/build/Release
cp node_modules/sharp/build/Release/sharp-darwin-arm64v8.node \
~/.bun/install/cache/sharp@0.32.6@@@1/build/Release/
# Restart Claude Code to reload the MCP server
Environment
- macOS (darwin-arm64)
- bun 1.3.9
- macrodata 0.1.3
- sharp 0.32.6 (transitive via
@xenova/transformers)
- 主要言語
- TypeScript
- スター
- 119
- フォーク
- 6
- 平均マージ
- 1時間 32分
- マージ済み PR(30日)
- 2
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ascorbic/macrodata のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
Support Cursor オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
ascorbic/macrodata の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
copse-dev/agent-pane#2953 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
calcite-components needs triage refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Esri/calcite-design-system#15203 ·