How to install an npm package from GitHub directly?

If Git is not installed, we can try:

npm install --save https://github.com/Amitesh/gulp-rev-all/tarball/master

Because https://github.com/visionmedia/express is the URL of a web page and not an npm module. Use this flavor: git+{url}.git

git+https://github.com/visionmedia/express.git

or this flavor if you need SSH:

git+ssh://[email protected]/visionmedia/express.git

To install from GitHub, you can also do

npm install visionmedia/express

Or

npm install visionmedia/express#branch

There is also support for installing directly from a Gist, Bitbucket, GitLab, and a number of other specialized formats. Look at the npm install documentation for them all.