Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Package readme is not being set, even though it exists in the directory. #31

OverZealous opened this Issue · 10 comments

5 participants


I'm moving this from npm/npm#4585 to here because I think the issue might be within read-package-json.

NOTE: The readme is showing up right now on this package do to the globOpts.sync hack I describe below.

I have an NPM package (gulp-cdnizer) that I'm working on. If I don't manually include the readme property in my package.json, then I get "ERROR: No README data found!" for the readme data.

I'm not doing anything funny with the .npmignore, and I don't actually understand how this is supposed to work. I've manually updated the readme on the previous packages I've published, but in researching this, I realized I shouldn't have to do this.

Hopefully you can help.


node: 0.10.25
npm:  1.3.25
read-package-json: 1.1.6

Since I originally wrote that, I've hacked around inside read-package-json, and I found that the readme function is getting called 4 times during npm publish. The first two (both in the original directory) successfully find a readme.

The second two (in some sort of deep temp directory, and under ~/.npm) both fail.

  • data.readme is not set
  • The dir variable is being set correctly.
  • Both of the failed directories do have a file.
  • The file exists before the glob call. Determined via:

    require('fs').existsSync(require('path').join(dir, ''))
  • When I directly run ls README?(.*) within those folder, the file is listed.
  • The file isn't coming through from the glob call at all (the files array is empty).
  • If I run glob synced, I get the correct file as a result:

    glob("README?(.*)", {cwd: dir, nocase: true, mark: true, sync: true})
  • Finally, if I simply add sync: true to globOpts, the readme is found and written correctly.

So, apparently it's an async issue?


@OverZealous - I tried the same workaround (adding sync: true to globOpts in read-json.js -> function readme(...)) and I can confirm it works for me as well.

Just thought I should mention it because there are other people facing the same issue.

Will you do a pull request?


I suppose, not sure if this is the right solution, but it's an easy PR to setup.


This bug still affects npm@1.4.2 :-(


It looks like the problem is because of the mark: true in the glob opts. Fix coming shortly.

This is a bug in glob that I haven't gotten around to fixing yet.


Thanks a lot for looking into it!


Great! Looking forward to the fix.

@boneskull boneskull referenced this issue from a commit in boneskull/karma-ng-server-side-template2js-preprocessor
@boneskull boneskull bump for npm issue npm/read-package-json#31 0f76fb4
@icflorescu icflorescu referenced this issue from a commit in icflorescu/aspax-jade-handler
@icflorescu icflorescu Version bump
Again, I have to redeploy on NPM because of

Recently hit me with npm 1.4.4 — now all the packages I recently republished shown "ERROR: No README data found!" on the npm site


Fixed in glob 3.2.9, just landed in npm. Will be in the next npm release.

@isaacs isaacs closed this

@isaacs I have a package that I can't raise the version as it is tightly coupled with another software, and is listed as "No README data found" node-webkit-builds. Any chance this can be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.