sharp fails to load: missing trustedDependencies in package.json

Đang mở Phù hợp với người mới
#24 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
74/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
bun
Lĩnh vực
tooling

Hướng nghiên cứu

Mở plugins/macrodata/package.json và kiểm tra cấu hình dependency của nó, sau đó đọc về hành vi trustedDependencies của Bun. Chạy bun install trong plugin và xác minh rằng binary native của sharp khả dụng để công cụ search_memory tải thành công trên môi trường được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

search_memory (and any tool that triggers @xenova/transformerssharp) 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)
Ngôn ngữ chính
TypeScript
Star
119
Fork
6
Merge trung bình
1 giờ 32 phút
Pull request đã merge (30 ngày)
2

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ascorbic/macrodata

Tất cả issue của ascorbic/macrodata

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.