npm to install packages from local position rather than from web?

The problem drove me crazy, there is a package in npm database, but it has some bugs, which are already fixed in github, how could I make use of the fixed version(github version)?

You can install directly from a URL, example:

npm install https://github.com/LearnBoost/socket.io/tarball/master

You can find the URL on Github under "Downloads" on any project page. Select the "Download as tar.gz" link.

Or you can install a tarball:

npm install foo.tar.gz

See npm install(1).

Edit:

I should mention that this works equally well in package.json files. Specify the URL instead of the version in your dependencies, like so:

...
"dependencies": {
  "foo": "http://example.com/foo.tar.gz",
  "bar": "1.2.x",
  ...
}

Either add the module as a git sub-module (using git submodule) to your project or tell the module maintainer to update the version and trigger a npm publish to update the npm repository.

When using the sub-module way, be aware that you cannot update the reference using npm-commands.

Other temporary solution, get the github project and use npm link (http://npmjs.org/doc/link.html) to link the local folder obtained through git to your node_modules folder in your own project. Anyway in the end, you'll have to wait for the project maintainer to do a npm publish.