Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Incorrect documentation / "log" event never fires #4343

robinduckett opened this Issue Dec 18, 2013 · 5 comments


None yet
5 participants

The README.md is incorrect:

var npm = require("npm")
npm.load(myConfigObject, function (er) {
  if (er) return handlError(er)
  npm.commands.install(["some", "args"], function (er, data) {
    if (er) return commandFailed(er)
    // command succeeded, and data might have some info
  npm.on("log", function (message) { .... })

Specifically the line:

npm.on("log", function (message) { .... })

As this callback / event never fires.

The only callback / event that does fire with the log messages is as follows:

npm.registry.log.on('log', function(message) {
    console.log('registrylog:', message);

Either the documentation is incorrect due to changes (i.e. it used to work, but the documentation hasn't been updated) or the documentation has always been incorrect, not sure which.

I haven't submitted a pull request as this should be a simple change to the documentation, unless it is the code that is wrong, as oppose to the documentation.


luk- commented Dec 18, 2013

We should update the docs.

timoweiss pushed a commit to timoweiss/npm that referenced this issue May 13, 2014

TooBug commented Aug 4, 2014

When will the docs be updated. I came across this a few days ago...


timoxley commented Aug 4, 2014

@TooBug why not submit a pull request?

TooBug commented Aug 4, 2014

There seems to be one already? timoweiss/npm@73c0cce

@othiym23 othiym23 closed this in bfbb1a4 Sep 21, 2014


othiym23 commented Sep 21, 2014

Finally got around to cleaning this up. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment