I made a test package with an export at ./settings . Node could import it from the source checkout. Then I packed the project and installed the tarball into a separate directory. The same import failed with ERR_MODULE_NOT_FOUND .
The cause was one line in package.json :
{ "exports" : { "." : "./index.cjs" , "./settings" : "./settings.mjs" } , "files" : [ "index.cjs" , "cli.cjs" ] }
Enter fullscreen mode
Exit fullscreen mode
settings.mjs existed in the checkout. The export pointed to it. The files list left it out of the tarball.
Why I built Pack Pilot
I wanted a release check that starts from the same artifact a user installs. Pack Pilot runs npm pack , installs the tarball into a temporary consumer project, and tries the public imports or CLI command I give it. The regression test uses a real npm tarball to reproduce the missing export.
For the example above, I’d add settings.mjs to files and rerun the consumer check.…