This warning appears when npm cannot find a README.md file in your package root directory during publication. While not required to publish, npm expects packages to include a README because it serves as the primary documentation displayed on npmjs.com.
Fixes npm WARN publish npm WARN publish No README.md file found
# My Package
A useful utility for X.
## Installation
\`\`\`bash
npm install my-package
\`\`\`
## Usage
\`\`\`javascript
const myPackage = require('my-package');
// example code
\`\`\`
## License
MIT# My PackageA useful utility for X.## Installation\`\`\`bashnpm install my-package\`\`\`## Usage\`\`\`javascriptconst myPackage = require('my-package');// example code\`\`\`## LicenseMITnpm WARN publish npm WARN publish No README.md file found
This warning appears when npm cannot find a README.md file in your package root directory during publication or installation. While technically not required to publish a package, npm expects published packages to include a README file because it serves as the primary documentation displayed on the package's npmjs.com page. The registry stores the first 64KB of the README content and renders it as GitHub Flavored Markdown. Without a README, your package page on npmjs.com shows "This package does not have a README" message, reducing discoverability and user confidence. This is a warning, not an error—your package will still publish, but it signals incomplete package metadata.
Create a new file named exactly README.md in your project's root directory (same level as package.json). This file must use the .md markdown extension.
At minimum, include:
# My Package
A useful utility for X.
## Installation
\`\`\`bash
npm install my-package
\`\`\`
## Usage
\`\`\`javascript
const myPackage = require('my-package');
// example code
\`\`\`
## License
MITExpand README with:
- Usage - Code examples showing how to use the package
- API - Function/method documentation
- Node/npm requirements - Minimum versions needed
- License - What license the package uses
- Badges - Build status, coverage, version badges (improves quality score)
Check your .npmignore file. Ensure it does NOT contain *.md or explicitly exclude README.md. If present, remove those lines—npm should never ignore README files.
Run npm pack to create a tarball and verify README.md is included:
npm pack
tar -tzf your-package-name-1.0.0.tgz | grep READMEShould show the README file in the output.
README Content Limits: npm stores only the first 64KB of README content. For large documentation, keep detailed docs in a separate documentation site.
Publishing Workflow: npm REQUIRES a version bump to update the README. Simply editing README.md and re-running npm publish with the same version will not update npmjs.com.
Quality Score Impact: Including a well-structured README with sections, code examples, and badges significantly improves your package's quality score on npmjs.com.
File Format: README.md should be UTF-8 encoded. npm's markdown renderer expects GitHub Flavored Markdown (GFM).