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 a package locally if you want to depend on the package from your own module, using something like Node. js require . This is npm install 's default behavior.
It's best to install locally when relying on a package from your module, such as Node. js. This is how npm install works by default. The grunt CLI package, for example, must be installed globally before it can be used as a command-line tool.
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",
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With