I am using gradle with gradle-node-plugin. The problem is that I don't have access to public registers so node cannot download anything from https://registry.npmjs.org/. I need to use nexus as proxy butt don't know how to change url to which npm is pointing. Does anyone know the solution?
Change registry url in gradle node plugin
4.5k views Asked by user3450486 At
2
There are 2 answers
0
On
If you want to do this directly in a gradle task you can use the following:
task setregistry(type: NpmTask) {
args = ['config', 'set', 'registry', 'https://npm.registry.company.com']
}
You can also do this if you want to set the registry for a specific scope:
task setregistry(type: NpmTask) {
args = ['config', 'set', '@scope:registry', 'https://npm.registry.company.com']
}
I believe the Gradle Node Plugin executes
npmitself to resolve modules so just updating your.npmrcwithregistry=https://npm.yourcompany.comought to work.Note that this is basically what
npm config set registrydoes, as RaGe suggested in his comment.