[Bug] README is not correctly shown on verdaccio using `yarn npm publish`
See original GitHub issueDescribe the bug
README is not correctly shown on self-hosted verdaccio using yarn npm publish
.
To Reproduce
(require docker to launch verdaccio so as to reproduce)
Reproduction
mkdir yarn-verdaccio-readme
cd yarn-verdaccio-readme
yarn set version berry
echo '
npmPublishRegistry: http://localhost:4873
unsafeHttpWhitelist: [localhost]
' >> .yarnrc.yml
echo '
{
"name": "yarn-verdaccio-readme",
"version": "0.1.0"
}
' > package.json
echo '# yarn-verdaccio-readme' > README.md
yarn
docker run --rm -p 4873:4873 -d verdaccio/verdaccio:4.8.1
echo 'input some random username/password'
yarn npm login --publish
yarn npm publish
echo 'open http://localhost:4873/-/web/detail/yarn-verdaccio-readme then you will see "ERROR: No README data found!".'
Screenshots
$ yarn npm publish
➤ YN0000: README.md
➤ YN0000: package.json
➤ YN0000: Package archive published
➤ YN0000: Done in 0.91s

Environment
- Yarn version 2.1.1
Additional context
README.md
is uploaded correctly.- No issue with
npm publish
.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:9 (4 by maintainers)
Top Results From Across the Web
@verdaccio/readme | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >npm ERR! 403 403 Forbidden npm publish - Stack Overflow
Probably there is already a package with the same name present on npm. Change package name in package.json and ...
Read more >How to test publishing your JavaScript package locally
Since I've started using npm as a JS package manager (maybe back in ... it's published, the "real" npm page, just to see...
Read more >to correct this please trying logging in again with: npm err ...
Try Deleting the package-lock.json file before running the command "npm install" after upgrading the node versions, if you have not done that.
Read more >Best practices for creating a modern npm package - Snyk
In this tutorial, we're going to walk step by step through creating an npm package using modern best practices (as of 2022).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I found the issue is that the
readme
field is missing in the publish body:https://github.com/yarnpkg/berry/blob/bedc0cf6816d5090f812083a9f84fde77584800b/packages/plugin-npm-cli/sources/commands/npm/publish.ts#L164-L199
Adding the
readme
field can fix the issue:I’m not sure if this should be fixed on the verdaccio side or the yarn side, but I’ll report this to the verdaccio repo as well.
Just a small notes from my side,
pnpm
had the same issue recently on v6 which was fixed a few weeks ago https://github.com/pnpm/pnpm/releases/tag/v6.24.1 https://github.com/pnpm/pnpm/pull/4117 . From verdaccio side, expects the body to contain areadme
property with a string of the readme content. Also checking npm8 still sends the readme https://github.com/npm/read-package-json/blob/main/read-json.js#L295