Fixing npm WARN: No description message

When installing modules using npm, you may see a WARN message in the console that says “No description.”

The following is an example of the message when I add grunt to my project:

$ npm install grunt   
npm WARN [email protected] No description

+ [email protected]
updated 1 package and audited 103 packages in 2.419s
found 0 vulnerabilities

The WARN message is just a warning check that you receive from npm.

Since r-app is the name of my JavaScript project, it means that the package.json file of my project doesn’t have a description property.

When you receive the same warning, add a description property to your package.json file as shown below:

{
  "name": "r-app",
  "version": "1.0.0",
  "description": "My test application",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "grunt": "^1.5.3"
  }
}

Note that you need to add something other than an empty string to make the warning go away.

The description property is used to add a brief description of your project. Alternatively, you can also set your project as private to suppress the error:

{
  "name": "r-app",
  "version": "1.0.0",
  "private": true,
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "grunt": "^1.5.3"
  }
}

With the private property set to true, npm won’t complain about the lack of the description property.

Sometimes, the warning can also appear from the package you install:

npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No description

In this case, you can try to reach out to the package maintainers and let them know about the warning.

But don’t worry because you can still use the package just fine. The description property doesn’t have any effect on the program itself.

Take your skills to the next level ⚡️

I'm sending out an occasional email with the latest tutorials on programming, web development, and statistics. Drop your email in the box below and I'll send new stuff straight into your inbox!

No spam. Unsubscribe anytime.