npm install <git> with dev dependencies

A typical approach to handle private npm modules is to put them to a Git repository, and then use npm install with the path to that repository to install the module.

If you enter the dependency into your package.json file, you can even install using npm install without the need to specify the repository url every time. I.e., if you add

"myPrivateModule": "git+ssh://git@github.com:myGitHubAccount/myPrivateModule.git"

as a dependency, you can install using

$ npm install myPrivateModule

and everything works fine :-).

Now I have a problem in that myPrivateModule is private, yes, but not a dependency. Instead, it's a dependency only for development time, hence I put it into the section devDependencies in the package.json file.

Once you do this,

$ npm install myPrivateModule

does not work any longer, as it now searches the public registry instead of using the registered path to the repository.

Is there a possibility to make this work, without the need to specify the full-blown path each and every time?

Just npm install with no arguments should read package.json and install it.