Trusted answers to developer questions

How to install an npm package from Github directly

Get Started With Machine Learning

Learn the fundamentals of Machine Learning with this free course. Future-proof your career by adding ML skills to your toolkit — or prepare to land a job in AI or Data Science.

Overview

NPM or Node Package Manager is a package manager generally used to publish or install node packages. We are all used to installing npm packages using the npm install command.

For example, to install the express module, we can perform the following:

npm install express

Installing NPM package directly from Github

npm install git+ssh://git@github.com:expressjs/express.git

Installing the package from a branch on Github

npm install git+ssh://git@github.com:expressjs/express.git/tree/{BRANCH}

Conclusion

Being able to download packages from Github allows us to download packages that may be private. That may be partially worked on, and hence cannot be uploaded to npm registry.

RELATED TAGS

github
Did you find this helpful?