This warning appears when your package.json file is missing or has an empty description field. The warning indicates missing metadata that helps users find your package on the npm registry through search.
This warning appears when your package.json file is missing or has an empty description field. The warning alerts you that npm packages benefit from having a human-readable description for discoverability and search indexing. While the warning doesn't prevent your package from working, it indicates missing metadata that helps users find your package on the npm registry. The description field is indexed by npm search and helps with ranking in the npm registry. This is a quality indicator rather than an errorโit simply tells you that your package is missing descriptive metadata that improves discoverability.
Locate the package.json file in your project root directory and open it with a text editor.
Add a clear, concise description that explains what your package does. Keep it under 140-200 characters for readability in npm listings.
{
"name": "my-package",
"version": "1.0.0",
"description": "A brief explanation of what your package does"
}Follow these guidelines:
- Use clear, simple language
- Start with an action verb when possible
- Explain the package's primary purpose
- Keep it to one sentence if possible
Good examples:
- "CLI tool for managing Docker containers"
- "Promise-based HTTP client for Node.js and browsers"
- "Unit testing framework with simple syntax"
Save package.json and run npm publish or npm publish --dry-run to verify the warning is gone.
If you don't intend to publish to the npm registry, suppress this warning by setting private: true:
{
"name": "my-package",
"version": "1.0.0",
"private": true
}This is appropriate for internal projects not meant for public consumption.
Discoverability: The description field is indexed by npm search and helps with SEO-like ranking in the npm registry. A good description significantly improves your package's chances of being found.
Keywords: The description works alongside the 'keywords' field (array of strings) to improve discoverability:
{
"description": "CLI tool for managing Docker containers",
"keywords": ["docker", "cli", "container", "devops"]
}Character limits: While there's no hard limit, npm displays approximately 100-200 characters in search results. Longer descriptions are truncated.
For private packages: Setting "private": true suppresses this warning since the package won't appear in npm search anyway.
npm ERR! code E401 npm ERR! 401 Unauthorized - Token has expired
Token has expired - npm authentication failure
npm ERR! code ENOAUDIT npm ERR! Audit endpoint not supported
How to fix "npm ERR! code ENOAUDIT - Audit endpoint not supported"
npm ERR! code EBADDEVENGINES npm ERR! devEngines.runtime incompatible with current node version
How to fix "npm ERR! code EBADDEVENGINES - devEngines.runtime incompatible with current node version"
npm ERR! code EAI_NODATA npm ERR! errno EAI_NODATA npm ERR! getaddrinfo EAI_NODATA registry.npmjs.org
How to fix "npm ERR! code EAI_NODATA - getaddrinfo EAI_NODATA"
npm ERR! code ETOOMANYARGS npm ERR! Too many arguments
How to fix "npm ERR! code ETOOMANYARGS - Too many arguments"