npm install from GitHub repository

Did you know that you’re not limited to installing npm packages from the npm registry?


You can also install packages from remote git providers like GitHub:

npm install<username>/<repository>

Here’s an example:

npm install

npm will try install the package via git clone.

If you save the dependency, your package.json will look something like:

  "dependencies": {
    "html-react-parser": "git+"


The default commit is master, but if you want to install a specific commit, tag, or branch, you can do the following:

npm install <username>/<repository>#<commit>

For example:

npm install remarkablemark/html-react-parser#v0.10.5

Your package.json will look something like this if the dependency is saved:

  "dependencies": {
    "html-react-parser": "git+"


You can even install a package from a gist:

npm install gist:<commit>

See example:

npm install gist:fd0837438d136e18c8e8eac559cd004a


To install from another git provider like Bitbucket:

npm install <protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit>]

The install would look something like this:

npm install git+ssh://[email protected]/<user>/<repository>.git


Check out the npm-install documentation for more information.

Please support this site and join our Discord!