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

node.js, npm

Solution

Edit:

You can install directly from the GitHub repository, even just using the GitHub username and the repository name:

`npm install LearnBoost/socket.io`

You can also add a `<commit-ish>`, specifying e.g. a commit hash or a version tag, like so:

`npm install LearnBoost/socket.io#1.7.x`

Without a protocol, this will be interpreted as `git://github.com/LearnBoost/socket.io`. You can also prefix the repo with `gitlab:`, `gist:` or `bitbucket:`, respectively. For more information, see Using git URLs as dependencies.

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",
  ...
}

Problem

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)?

Original source