2

I'm a lead author of the npm package scramjet - since a month I have a problem regarding the visibility of the README.md in npmjs.

The scramjet package in npm shows:

"Unable to find a readme for scramjet@4.33.2"

But at the same time the README.md file is there and npm command doesn't complain about any info.

I checked if this is not caused by:

  • external images
  • length of the readme
  • I tried publishing again

The README shows up nicely in github and the file is also added to package.json/files here.

I tried npm support, but they stopped replying so maybe someone here has an idea?

Edit: I'm publishing this from a tarball I get from github - so npm publish <url from gh>

RobC
  • 22,977
  • 20
  • 73
  • 80
Michał Karpacki
  • 2,588
  • 21
  • 34
  • It's a bit worse, since I do have another package `scramjet-core` that doesn't even have `files` key in `package.json`... and the same thing still persists. – Michał Karpacki Jul 02 '20 at 09:22
  • The other thing that's odd about your pkg is... When unpacking a `.tgz` file from the npm registry typically all the package contents get extracted into a folder named `package`. However when unpacking your `scramjet-4.33.2.tgz` the content gets extracted into a folder named `scramjet-4.33.2`. – RobC Jul 02 '20 at 09:26
  • That is a fantastic lead, I'm publishing this from a tarball I get from github - so `npm publish `. I'll rebuild this script. – Michał Karpacki Jul 02 '20 at 09:43

1 Answers1

3

Your scramjet-4.33.2.tgz archive, that currently exists in the npm registry, when extracted produces something like the following directory structure:

scramjet-4.33.2          <-----
├── CHANGELOG.md
├── CNAME
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── docs
│   └── ...
├── greenkeeper.json
├── gulpfile.js
├── jsconfig.json
├── jsdoc2md
│   └── ...
├── lib
│   └── ...
├── package-lock.json
├── package.json
└── ...

Note: the name of the root directory (indicated above) is currently scramjet-4.33.2

NPM expects the root directory to be named package therefore it is unable to find the README.md.

To clarify further, your .tgz directory structure should be as follows:

package                  <----- Note: changed to `package`
├── CHANGELOG.md
├── CNAME
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── docs
│   └── ...
├── greenkeeper.json
├── gulpfile.js
├── jsconfig.json
├── jsdoc2md
│   └── ...
├── lib
│   └── ...
├── package-lock.json
├── package.json
└── ...

Edit from author of the question:

Additonally some background - the above situation happens if you try to publish your packages straight from github releases which used to work before, so don't do this anymore:

npm publish https://github.com/anorg/arepo/archive/v1.2.3.tar.gz

Instead use npm pack to create a tarball or just run npm publish in your working copy.

Michał Karpacki
  • 2,588
  • 21
  • 34
RobC
  • 22,977
  • 20
  • 73
  • 80