A fix for dependencies whose install scripts replace a JavaScript launcher with a native binary — most visibly esbuild.
Native-executable bins
A package's bin can start as a JavaScript launcher and be swapped for a platform-native executable by its install script — esbuild does exactly this. nub linked the node_modules/.bin entry before the install script ran, so the shim invoked the binary as node <binary> and failed with a syntax error (nubx esbuild, ./node_modules/.bin/esbuild, and any script calling esbuild).
nub now detects native executables (ELF, Mach-O, PE) and runs them directly — a symlink on Unix, a direct-exec wrapper on Windows — instead of wrapping them in node. Bin shims are also regenerated after dependency install scripts run, so a launcher that turns native mid-install gets the correct shim, including on the side-effects-cache restore path. (#412, fixes #394)
What's Changed
- fix(linker): exec native-executable bins directly instead of wrapping in node by @colinhacks in #412
Full Changelog: v0.4.6...v0.4.7