Install NPM Packages from GitHub Directly

Published on August 20, 2020 19 sec read

HIRE US 🖐
We're available to do freelance project. Take a look at our services!

Today I’m going to share how to install npm packages from GitHub repository.

Installing Package

Visit your npm package repository and copy the https URL of the repo. Then run like this to install the package:

npm install https://github.com/expressjs/express

We can also set a specific version number like this:

npm install https://github.com/expressjs/express#semver:4.17.1

After installing the package, it’ll add the following dependency to package.json file.

"dependencies": {
  "express": "git+https://github.com/expressjs/express.git"
}
That’s it. Thanks for reading. 🙂

Author

Hey, I'm Md Obydullah. I build open-source projects and write on Laravel, Linux server, modern JavaScript and more on web development.

Follow

Leave a Reply

Your email address will not be published. Required fields are marked *