Prerequisites
- Node.js 20+
- pnpm (recommended,
npmandyarnalso work, but the FUSE binding’s install script needs extra configuration with pnpm).
System FUSE
Install the OS-level FUSE kernel support first:- macOS FUSE Setup, macFUSE + kernel extension + Apple Silicon recovery mode steps.
- Linux FUSE Setup,
fuse3install and/etc/fuse.conf.
Install the Node Binding
The Node package (@struktoai/mirage-node) ships FUSE support via an optional peer dependency on @zkochan/fuse-native, the pnpm author’s actively-maintained fork that works on Node 20+ and supports both macOS and Linux (thanks to @zkochan).
Allow pnpm to run the install script
@zkochan/fuse-native compiles native code on install. pnpm blocks install scripts by default, allow this one explicitly in pnpm-workspace.yaml:
package.json:
macOS 4+ Symlink Workaround
- macOS
- Linux
macFUSE 4 ships
libfuse.2.dylib instead of the legacy libosxfuse.2.dylib that @zkochan/fuse-native was built against. Create a one-time symlink:Verify
ws.fuseMountpoints prints a /tmp/mirage-fuse-XXXXXX path and no error is thrown, the binding is wired up correctly.
Per-mount FUSE
FUSE is configured per mount. Each mount whosefuse is set is exposed at
its own mountpoint, showing only that mount’s subtree. The value is either
true (mount at a fresh temp directory) or a path string (mount there,
creating the directory if missing):
fuseMounts: { '/data': '/tmp/data-repo', '/s3': true }.
ws.fuseMountpoints returns a { prefix: path } map of the live mountpoints.
FUSE on Node has a runtime constraint worth knowing,
fs-monkey can’t patch ESM node:fs imports. See TypeScript Limitations for details and workarounds.