npm pack leaving out files (6.8.0 only)

What I Wanted to Do

Run npm pack on an angular package built by ng-packagr

What Happened Instead

the pack command runs correctly, however a few files are missing from the resulting tar.

Reproduction Steps

Install npm version 6.7.0 and run npm pack

Install npm version 6.8.0 and run npm pack and compare with previous version

Details

I can’t provide the source code due to it’s proprietary nature.

Platform Info

$ npm --versions
{ '@iverticle/web-apps-shared': '0.21.18',
  npm: '6.8.0',
  ares: '1.15.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',
  node: '10.15.0',
  openssl: '1.1.0j',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '6.8.275.32-node.45',
  zlib: '1.2.11' }

$ node -p process.platform
linux

Might be hard to chase without someone else having same issue with concrete details, but I have some questions that don’t involve source code.

How is the package manifest being decided? In order do you have a files section in package.json, or a .npmignore file, or is it falling back to .gitignore file?

Do you happen to know if your issue affects publish as well as pack?

We have same issue after update to 6.8.0. In our case npm publish skips all files in core directory.
There are no rules for that folder in .gitignore/.npmignore files.

2 Likes

@lukk I think you might have figured out a big part of the issue. The folder that is left out of my build is also called “core”.

@shadowspawn I also do not have a files section in the package.json and I do not have .gitignore/.npmignore files

and this is root cause I think…

2 Likes

Good find! A general workaround seems to be a !core rule in .npmignore/.gitignore, or making use of the files settings.

1 Like

I’m also experiencing this issue in my package, when installing (from GitHub, not yet published to npm), users are finding they’re missing a core folder.

Thanks for reporting @amishshah as not obvious also affects installs too. I reproduced with:

$ npm init -y
$ npm install -g npm@6.7
$ npm install https://github.com/amishshah/prism-media
$ ls node_modules/prism-media/src/core
FFmpeg.js	PCMVolume.js	WebmBase.js	index.js
$ npm install -g npm@6.8
$ npm install https://github.com/amishshah/prism-media
$ ls node_modules/prism-media/src/core
ls: node_modules/prism-media/src/core: No such file or directory

Thanks for doing the testing for me! This is a pretty unbelievable issue, hope it gets fixed soon.

Original PR: https://github.com/npm/npm-packlist/pull/25
Included in: https://github.com/npm/npm-packlist/pull/26

@larsgw thanks! What version will this end up in?

It will be included in npm@6.9.0. I’m tagging the prerelease this week.

2 Likes

Thanks :) I’ve experienced this thing too.

Problem fixed in 6.9. Great!

I was still getting this using npm 6.9 to install a package w/ a core folder directly from a git repo. Running npm cache clean --force, uninstalling, and reinstalling the package fixed the issue.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.