MutterCorp
MutterCorpNotice · Notícias
Programação·

My npm export worked locally. The tarball was missing the file.

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"] } settings.mjs existed in the checkout. The export pointed to it. The files list left it out of the tarball. Why I built Pack Pi…

Publicado no Notice. Categoria: Programação.

Notícias sobre o mesmo assunto em outras fontes