fix: add scripts/lib to npm package files to resolve npx MODULE_NOT_FOUND#43
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 npxcouldn't find
paths.js,file-ops.js, andconfig-mutator.js.Error: Cannot find module './scripts/lib/paths.js'
Fix
"scripts/lib"topackage.json"files"arraytest-npx-integrity.js: validates everyrequire()ininstall.jsresolves from the package root (7 assertions)
doctor.jsandnpm run validate:npxValidation
7/7 npx integrity tests pass. All existing validation gates unchanged.
Risk & Rollback
"files"array (but you lose themodularized install.js — the 3 lib files are required at runtime)