nodefit
Finds the Node.js version every dependency supports, and catches native modules with no prebuilt binary before npm install falls back to node-gyp and fails.
236 downloads / 30 days · npm
npx @pypilot-dev/nodefit doctornodefit is PyPilot's approach applied to Node.js. Every package narrows the Node releases a project can run on: its engines.node range, and for a native module such as better-sqlite3, sharp, bcrypt or canvas, the releases it ships a prebuilt binary for on your platform. nodefit intersects them and recommends a release. When nothing fits, it names the two packages that clash, so a project that pins node-sass 4 next to a current sharp gets one sentence explaining why no Node version works, instead of a page of compiler errors.
How it works
- What's installed comes from the lockfile (npm, bun, pnpm, and both yarn classic and berry), or without one from
package.jsonresolved the way npm would. - What each package allows is its
engines.noderange, plus, for native modules, the releases with a prebuilt binary for this platform. nodefit knows the different ways binaries are shipped: per-platform packages (sharp, esbuild, @swc/core), binaries inside the tarball, downloads at install time, and packages that always compile. - Node releases come from nodejs.org, with each release's native ABI, N-API level and end-of-life date. A snapshot ships with the package for offline use.
- This machine is read too: the
nodeon your PATH, the version managers you have installed (nvm, fnm, volta, mise, asdf, n) and the pins the project already has (.nvmrc,.node-version,enginesand others).
Using it
The npm package is a CLI with doctor, check and pin commands, a language server and a library. It runs on Node 18 or later and has no dependencies of its own. Editors can run nodefit lsp --stdio for diagnostics on package.json, and the repository also holds a VS Code extension built around that language server.