Add explicit information about package tarball directory structure to docs


(Maksym Kobieliev) #1

Documentation should be explicit about the format of the package tarball files.
Here it’s written that one can install a tarball file directly as an npm package. However, there is no information about the specific requirements for the file to be correctly interpreted and installed by npm.
I had to spend quite some time to find out that a tarball will only get correctly recognized if all the files are located in the package directory of the tarball (see https://github.com/npm/npm/issues/20940#issuecomment-396348436). This information should be explicitly stated in the docs.


(Rebecca Turner) #2

We would take a PR for that! The only things to know about package tarballs are that one directory layer in the tarball is stripped (what its called doesn’t matter, this is the equivalent of tar x --strip-components=1) and there must be a package.json with name and version properties.


(Maksym Kobieliev) #3

Done: https://github.com/npm/npm/pull/20986