I ran into the same problem and found the answer here .
You need to specify the path to the directory (or archive) that you are trying to publish. Although the documentation on npmjs.org does not actually indicate this, if you run npm help publish , you will get a manual page that shows that the correct use is actually
npm publish <tarball> [--tag <tag>] npm publish <folder> [--tag <tag>]
I also found that I had to actually enter the path: I could not just use npm publish . from the directory containing my package.json file.
Hope this helps.
Samuel B. Johnson
source share