npm isn't updating my git based dependencies?
Mar 2, 2019
2 minute read

Is a simple command line utility that searches package.json files and updates packages that have git URL dependencies. Because this issue exists that doesn’t appear to be going away any time soon, I created a simple utility as a work around.

Installing

npm i -g npm-git-package-update

Usage

ngpu --help

ngpu –help Usage: ngpu [options]

Options: -V, –version output the version number -r, –recursive recursively update package.json excluding node_modules and hidden folders -h, –help output usage information

GIT URL Dependencies

You may be asking yourself what is a GIT based dependencies in my package.json. npm allows a user to specify the location of a package not only by name from a repository but also via http and git urls. If you are developing a private package and don’t want pay for or host a private repository using git based dependencies is a fast solution. It also brings the convenience that if you use a public/private key pair (which you should) for interacting with your git hosts then no additional authentication is necessary.

Adding a Git Based Dependency to my package.json

Adding a git based dependency to a npm package is as simple as installing a regular npm package. Simply append the location and user name in front of the package name and npm is smart enough to take care of the rest.

npm i github:Stieneee/my-private-package
npm i gitlab:Stieneee/my-other-private-package

Let me know if the package helped you out!

In a later post I am going to discuss Docker build with git base URL dependencies. :)



comments powered by Disqus