You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then NPM/Yarn will be downloaded from registry.npmjs.org, rather than from the mirror site I set in <PROJECT_DIR>/.npmrc.
The reason is, when installing a global package (npm install -g --prefix=<PROJECT_DIR>/.gradle/npm/... npm@<VERSION>), the registry setting in <PROJECT_DIR>/.npmrc is not used.
So far I know the followings:
What works:
** Set registry=http://my-registry.com:1234/repository/ in ~/.npmrc. (A project-level setting would be more ideal for my company though.)
What does not work:
** npmSetup.args += ['--registry=http://my-registry.com:1234/repository/'] yarnSetup.args += ['--registry=http://my-registry.com:1234/repository/'] (In those tasks, args is write-only, according to Gradle.
The text was updated successfully, but these errors were encountered:
This apparently overwrites them if I try do do npmSetup.arg += ..., as indicated by @rkrisztian:
It does seem to work if I do this in an afterEvaluate, but that seems an odd way to define that, and I'm not sure if its guaranteed who comes first, project or plugin.
But I agree that the plugin shouldn't be using afterEvaluate to initialize the arguments, as that is a bad design that also forces us to have to use afterEvaluate as well.
(This ticket is closed though, so IMO I should ask you to open a new one with your info.)
If you have this in your Gradle script:
Or this:
Then NPM/Yarn will be downloaded from
registry.npmjs.org
, rather than from the mirror site I set in<PROJECT_DIR>/.npmrc
.The reason is, when installing a global package (
npm install -g --prefix=<PROJECT_DIR>/.gradle/npm/... npm@<VERSION>
), the registry setting in<PROJECT_DIR>/.npmrc
is not used.So far I know the followings:
** Set
registry=http://my-registry.com:1234/repository/
in~/.npmrc
. (A project-level setting would be more ideal for my company though.)**
npmSetup.args += ['--registry=http://my-registry.com:1234/repository/'] yarnSetup.args += ['--registry=http://my-registry.com:1234/repository/']
(In those tasks,args
is write-only, according to Gradle.The text was updated successfully, but these errors were encountered: