How to specify registry while doing npm install with git remote url?

Not the best way but If you are using mac or linux even in you can set alias for different registries.

##############NPM ALIASES######################
alias npm-default='npm config set registry https://registry.npmjs.org'
alias npm-sinopia='npm config set registry http://localhost:4873/'

Yes, you need to use:

npm config set registry <registry url>.

to make sure you install your package from the registry inside your company.

If you are doing npm -i -g, this is to install globally.

you need to do:

npm -g config set registry <registry url>

npm gets its config settings from the command line, environment variables, and npmrc files. You can try to specify registry in a npmrc file, and module in the command line. To change registry, you can use command:

npm config set registry <registry url>

You can also change configs with the help of -- argument. Putting --foo bar on the command line sets the foo configuration parameter to "bar". So you can try something like that:

 npm install http://git.repo.url --registry=https://your.registry.local/