Installing npm packages from multiple registries

Work on a project where I need to install npm packages from several registries - the default registry is npm and several custom registries.

My existing solution is to use npm scripts to split the installation into steps that use the --registry flag. Something like that:

 "install-pkg1": "npm install pkg1 --registry https://pkg1.domain.com", "install-pkg2": "npm install pkg2 --registry https://pkg2.domain.com", "install-custom": "npm install && npm run install-pkg1 && npm run install-pkg2" 

Then use npm run install-custom instead of npm install to install all the dependencies.

Is there a more preferable method for installing packages from multiple registries?

As noted in the comments below, this discussion has a discussion about Github .

+6
source share

Source: https://habr.com/ru/post/1011771/


All Articles