https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
d

Davin reinaldo gozali

03/18/2021, 6:53 AM
Anyone know how to set proxy for yarn & npm session inside konan ? I have problem when working behind corporate proxy and build my multiplatform project that contain js module. I always get :
Copy code
Error: Couldn't find package "karma-webpack@4.0.2" required by "qris-multiplatform-lib-test@1.1.8-rc1" on the "npm" registry.
    at MessageError.ExtendableBuiltin (C:\Users\davin\.gradle\yarn\yarn-v1.15.2\lib\cli.js:721:66)
    at new MessageError (C:\Users\davin\.gradle\yarn\yarn-v1.15.2\lib\cli.js:750:123)
    at PackageRequest.<anonymous> (C:\Users\davin\.gradle\yarn\yarn-v1.15.2\lib\cli.js:35729:17)
    at Generator.throw (<anonymous>)
    at step (C:\Users\davin\.gradle\yarn\yarn-v1.15.2\lib\cli.js:304:30)
    at C:\Users\davin\.gradle\yarn\yarn-v1.15.2\lib\cli.js:317:13
    at process._tickCallback (internal/process/next_tick.js:68:7)
I'm already try to switch using public connection and work smoothly set proxy to
C:\Users\<username>\.npmrc
or
C:\Users\<username>\.yarnrc
don't give any effect should I change proxy configuration via gradle DSL ? or is there any solution for these issue ?
b

Big Chungus

03/18/2021, 8:37 AM
Declare your repos in ~/.npmrc
d

Davin reinaldo gozali

03/18/2021, 10:02 AM
it didn't work, I think that cannot solve the issue since npm and yarn run using internal gradle cache
Copy code
Error: Couldn't find package "karma-webpack@4.0.2" required by "qris-multiplatform-lib-test@1.1.8-rc1" on the "npm" registry.
    at MessageError.ExtendableBuiltin (C:\Users\davin\.gradle\yarn\yarn-v1.15.2\lib\cli.js:721:66)
    at new MessageError (C:\Users\davin\.gradle\yarn\yarn-v1.15.2\lib\cli.js:750:123)
    at PackageRequest.<anonymous> (C:\Users\davin\.gradle\yarn\yarn-v1.15.2\lib\cli.js:35729:17)
    at Generator.throw (<anonymous>)
    at step (C:\Users\davin\.gradle\yarn\yarn-v1.15.2\lib\cli.js:304:30)
    at C:\Users\davin\.gradle\yarn\yarn-v1.15.2\lib\cli.js:317:13
    at process._tickCallback (internal/process/next_tick.js:68:7)
Error: Couldn't find package "karma-chrome-launcher@3.1.0" required by "qris-multiplatform-lib-test@1.1.8-rc1" on the "npm" registry.
    at MessageError.ExtendableBuiltin (C:\Users\davin\.gradle\yarn\yarn-v1.15.2\lib\cli.js:721:66)
    at new MessageError (C:\Users\davin\.gradle\yarn\yarn-v1.15.2\lib\cli.js:750:123)
    at PackageRequest.<anonymous> (C:\Users\davin\.gradle\yarn\yarn-v1.15.2\lib\cli.js:35729:17)
    at Generator.throw (<anonymous>)
    at step (C:\Users\davin\.gradle\yarn\yarn-v1.15.2\lib\cli.js:304:30)
maybe is there any way to set it via gradle ?
the problem is about to set the proxy , I've already test it by switching to my public connection and work smoothly
and setting my global yarn / node proxy won't affect the build config
since it used it via gradle (C:\Users\<username>\.gradle\
d

Dragan Marjanovic

03/18/2021, 9:02 PM
Have you already tried setting
systemProp.http.*
and|or
systemProp.https.*
in your
\Users\<username>\.gradle\gradle.properties
? Official docs: https://docs.gradle.org/current/userguide/build_environment.html#sec:accessing_the_web_via_a_proxy
d

Davin reinaldo gozali

03/19/2021, 11:24 AM
yes, I've tried that too, still didn't work
I just try setup proxy via command line inside specific .gradle cache session for example :
Copy code
C:\Users\<username>\.gradle\yarn\yarn-v1.15.2
C:\Users\<username>\.gradle\nodejs\node-v12.16.1-win-x64
then I set the proxy directly to
npm
and
yarn
executable inside that specific gradle generated session cache and my build now work but still I don't think that's the proper way since I need to manually set the proxy if I delete the gradle cache inside .gradle
43 Views