194

I have a simple package.json:

{
  "name": "camapaign",
  "version": "0.0.1",
  "scripts": {
    "start": "node app.js"
  },
  "engines": {
    "node": "0.10.15",
    "npm": "1.3.5"
  },
  "repository": { 
    "type": "svn",
    "url": ""
  }
}

When I execute "npm install" i get the following warning which I would like to fix:

"npm WARN package.json camapaign@0.0.1 No readme data."

I have tried adding "README.md" & "readme.txt" to the same dir as the package but with no joy. What am I missing?

Soviut
  • 88,194
  • 49
  • 192
  • 260
iancrowther
  • 5,143
  • 4
  • 25
  • 25
  • An answer from NPM support that may be relevant for some: "It was just a delay in the website's cache needing to catch up to the publish." – Joshua Pinter Mar 30 '16 at 01:40

6 Answers6

225

Simply adding a README.md file will not fix it, you should write something inside it; at least the project title and a brief description is good for people! But for NPM, one byte may be enough...
Doing so should stop showing the warnings.

Also, when you read that warning, ensure that the problem is not related to a 3rd party package.

gustavohenke
  • 40,997
  • 14
  • 121
  • 129
  • 23
    I have this issue and I do have a non-empty README file... :/ – mgol Feb 03 '14 at 15:20
  • 1
    Is it `README`, `README.markdown` or what? I'm afraid to say that only works with `README.md`... try it! – gustavohenke Feb 03 '14 at 17:18
  • 3
    I too have a `README.md` file with a whole bunch of stuff in it in the same directory as my `package.json`, and still get this (in relation to karma-coffee-preprocessor) – Conan Jun 26 '14 at 14:27
  • 2
    Yup, same as @Conan. `README.md` file, populated, still getting the error. – Nathan Hornby Oct 23 '14 at 13:06
  • 1
    @NathanHornby be sure that the problem isn't related to a 3rd party package. – gustavohenke Oct 23 '14 at 13:35
  • 4
    @gustavohenke How silly of me, you're right - the warning was for a package, not my app – Nathan Hornby Oct 23 '14 at 14:41
  • 2
    @NathanHornby as it was useful for you, I added it in the answer :) – gustavohenke Oct 23 '14 at 16:23
  • +1 I came here because I got `npm WARN saveError ENOENT: no such file or directory, open '/package.json'` `npm WARN enoent ENOENT: no such file or directory, open '/package.json'` followed by several `npm WARN ` errors. Your comment "ensure that the problem is not related to a 3rd party package" helped me plus this one too: https://stackoverflow.com/questions/9484829/npm-cant-find-package-json - thanks! – therobyouknow Sep 25 '18 at 18:05
176

Just set as private ;)

{
  "name": "camapaign",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node app.js"
  },
  "engines": {
    "node": "0.10.15",
    "npm": "1.3.5"
  },
  "repository": { 
    "type": "svn",
    "url": ""
  }
}
Klayton Faria
  • 1,905
  • 1
  • 12
  • 7
  • 6
    It should be noted that the property `private` tells npm that this is not a project intended to be available on the npm repository. You can see that someone already asked what's that property used for http://stackoverflow.com/a/7314961/1128216 – Jonathan Morales Vélez Aug 28 '14 at 02:35
  • 2
    If you set "private": true in your package.json, then npm will refuse to publish it. ref: `https://www.npmjs.org/doc/files/package.json.html` – AlexStack Nov 05 '14 at 12:51
  • 3
    Actually, in newer versions of NPM, it doesn't matter if the package is private or not. You must have a `README.md` file. @gustavohenke answer suits better every version. – ViniciusPires Dec 23 '14 at 20:22
  • This works okay if you are just using it to generate some output code and don't really need a full source package. – Neil Monroe Apr 14 '15 at 15:40
  • I would word this answer something like - Of course, the only reason not to have a `README.md` file is that your project is private. So either write a proper `README.md` **or** set the private flag. – rustyx Sep 21 '15 at 14:53
10

Adding a README.md to your project root is the answer, but I've noticed that it takes a short while for NPM to pick up on this. Maybe a few minutes?

Richard Hunter
  • 1,933
  • 2
  • 15
  • 22
  • 3
    It's true that after you publish it takes a moment to update NPM's listings. Here's a response from NPM's support: "It was just a delay in the website's cache needing to catch up to the publish." – Joshua Pinter Mar 30 '16 at 01:41
1

Add to package.json "readme": "README.md"

  • 6
    adding this property results in the *text* "README.md" displaying on the detail page on npmjs.com. Evidently, it is for raw markdown and not a filename. – code_monk Jun 25 '15 at 16:27
  • It does however remove the npm warning - just not in the way this answer implies. – rogersillito Dec 17 '15 at 17:44
  • @code_monk so we could write something like "see [README.md](https://github.com/aloisdg/attrithub/blob/master/README.md)" – aloisdg Feb 05 '16 at 12:44
  • 1
    you could, but AFAIK simply adding a README.md at the root of your repo will fix this warning; which is a Good Idea, and will help your users understand how your software works – code_monk Feb 07 '16 at 03:32
0

As of today, Apr 2017, just setting below in package.json, still works fine:

"private": true

this means its your private repository

even, with latest npm, it works fine:

npm update -g npm
> 3.10.8
Manohar Reddy Poreddy
  • 25,399
  • 9
  • 157
  • 140
0

my solution

  • npm show
  • npm dist-tag add

1.use npm show check the remote website deploy info.

eg.should like this:

SOME_PACKAGEs@0.3.60-beta | Proprietary | deps: 14 | versions: 289
<span style="color:red;">最新日志倒序在这里增加,注明作者+日期+功能</span>

dist
.tarball: https://registry.npmjs.org/xxx/-/xxx-0.3.60-beta.tgz
.shasum: 021e30640a62f13905b1e2b7a4facd169df46a1d
.integrity: sha512-9N4pUwwoYGNek34fCCCjURuQdx1K5VBlCWl4t1sy8wi3xul/N/TiDvjmUBF24t2Dg2fX6cFM9on+tftnVaEr7A==
.unpackedSize: 114.5 kB

dependencies:
@hanyk/rc-viewer: ^0.0.3        crypto-js: ^3.1.9-1             moment: ^2.25.3                 react-dom: ^16.12.0             uuid: ^3.3.3                    
axios: ^0.19.0                  dirty-json-ie11: ^0.0.2         query-string: ^6.9.0            react-quill: ^1.3.3             yqquill-image-drop-module: ^0.0 
cookie-universal: ^2.0.16       md5: ^2.2.1                     quill-delta-to-html: ^0.11.0    react-resizable: ^1.10.1        

maintainers:
- jyjin <jyjin@qq.com>
- jyjin1 <jyjin1@163.com>
- jyjin2 <jyjin2@163.com>

dist-tags:
beta: 0.3.61-beta    latest: 0.3.53-beta  

published 26 minutes ago by jyjin1 <jyjin1@163.com>

2.npm dist-tag add [PACKAGE_NAME]@[VERSION]

and then update lasest 0.3.53-beta to 0.3.61-beta

npm dist-tag add SOME_PACKAGE@0.3.61-beta

3.npm show check agin

same to step 1

go back to your npm package site, all have refreshed!


Wish to helps, thanks~

[One Chinese Teach]希望对您有帮助,谢谢~

Community
  • 1
  • 1
jyjin
  • 95
  • 7