Skip to content

fix: add scripts/lib to npm package files to resolve npx MODULE_NOT_FOUND#43

Merged
shahboura merged 1 commit into
mainfrom
fix/npx-module-resolution
May 7, 2026
Merged

fix: add scripts/lib to npm package files to resolve npx MODULE_NOT_FOUND#43
shahboura merged 1 commit into
mainfrom
fix/npx-module-resolution

Conversation

@shahboura

@shahboura shahboura commented May 7, 2026

Copy link
Copy Markdown
Owner

Summary

npx installation broke after install.js modularization (1.5.0 → 2.0.0). The
scripts/lib/ directory wasn't included in the npm "files" array, so npx
couldn't find paths.js, file-ops.js, and config-mutator.js.
Error: Cannot find module './scripts/lib/paths.js'

Fix

  • Added "scripts/lib" to package.json "files" array
  • New test-npx-integrity.js: validates every require() in install.js
    resolves from the package root (7 assertions)
  • Added to doctor.js and npm run validate:npx
  • Package size: +6 KB (3 lib files)

Validation

7/7 npx integrity tests pass. All existing validation gates unchanged.

Risk & Rollback

  • Risk level: [medium]
  • Rollback approach: revert to previous "files" array (but you lose the
    modularized install.js — the 3 lib files are required at runtime)

- Add scripts/lib to package.json files array (was missing, broke npx)
- Add test-npx-integrity.js: verifies all files in 'files' exist and
  all require() paths in install.js resolve from package root
- Add test to doctor.js and npm scripts (validate:npx)
- Prevents MODULE_NOT_FOUND errors in future npm publishes
@shahboura shahboura merged commit dddad7f into main May 7, 2026
29 of 31 checks passed
@shahboura shahboura deleted the fix/npx-module-resolution branch May 7, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant