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?
Asked
Active
Viewed 3,993 times
3
-
1Maybe you can create a task that runs `npm config set registry ...` ? – RaGe Feb 19 '16 at 16:50
2 Answers
3
I believe the Gradle Node Plugin executes npm
itself to resolve modules so just updating your .npmrc
with registry=https://npm.yourcompany.com
ought to work.
Note that this is basically what npm config set registry
does, as RaGe suggested in his comment.

Eric Wendelin
- 43,147
- 9
- 68
- 92
-
where should the npmrc be in relation to the project or build for the gradle node plugin's npm to utilize it? – Jake Jun 07 '17 at 18:58
-
0
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']
}

MGothe
- 11
- 3