Spent 3 days writing a native Node.js addon in Rust. Spent 2 more days just trying to get npm install to actually work. Here's everything that went wrong.

Writing the Rust code was, genuinely, the easy part. Getting a working binary into someone else's node_modules turned out to be its own multi-day debugging saga. Sharing it because I suspect most of this is completely undocumented anywhere, and I only found out by breaking things. Bug 1: the CI passes, the binary compiles, tests are green — and it still doesn't install. Cross-platform native addons (via napi-rs, but this applies to any N-API/node-gyp project) ship as multiple packages: a JS wrapper, plus on

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论