Bin field or entry point is correctly configured
Why it matters
A bin field pointing to ./dist/cli.js when no dist/ directory exists is a package that installs successfully and then fails on first invocation with env: node: No such file or directory or Cannot find module. Pointing bin at a .ts file is worse — npx mytool dies with a syntax error on the first import statement. Users uninstall immediately and leave a one-star review. This is the single most common CLI publish-to-npm failure mode.
Severity rationale
Critical because a broken entry point makes the CLI uninstallable or non-executable on every user's first try.
Remediation
Set bin in package.json to the compiled JS file, wire a prepublishOnly build script, and include the output directory in files. Verify dist/cli.js exists after npm run build:
{
"bin": { "mytool": "./dist/cli.js" },
"files": ["dist"],
"scripts": {
"build": "tsc",
"prepublishOnly": "npm run build"
}
}
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the CLI Quality Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
Taxons
History
- 2026-04-18·v1.0.0·Initial import from cli-quality·automated