Closed zouyi100 closed 1 year ago
Thanks for reporting. Could you please also share the contents of C:\Users\zoi7sgh\.npmrc
and C:\Program Files\nodejs\etc\npmrc
? We only care about what other configuration you have, so please redact any sensitive values.
This will help us in trying to reproduce the issue. Thank you.
My current assumption is that maybe you have other relevant proxy configuration in those files. And while npm is using them, UI5 Tooling is currently ignoring those.
Hi @RandomByte Thanks for your reply. This is the c:\userfolder.npmrc
proxy=http://xxxxxxx@xxxxxxxxx:xxxx/
https-proxy=http://xxxxxxx@xxxxxxxxx:xxxx/
registry=https://registry.npmjs.org/
There is no npmrc in nodejs\etc\npmrc. I'm now using the nvm on windows to enable my nodejs env. Also in my ubuntu wsl env. There is a npmrc in ~. also with the same issue.
So if ui5 tooling ignore those proxy config, how could we set proxy for ui5-tooling.
Could you please run npm info @openui5/sap.f
in the same folder to verify whether npm can fetch the relevant package information?
Result is
PS C:\Users\zoi7sgh\Documents\Project\test\openui5-sample-app> npm info @openui5/sap.f
@openui5/sap.f@1.113.0 | Apache-2.0 | deps: 3 | versions: 415
OpenUI5 UI Library sap.f
keywords: openui5, sapui5, ui5
dist
.tarball: https://registry.npmjs.org/@openui5/sap.f/-/sap.f-1.113.0.tgz
.shasum: f08098485ceacdab1fcd084b530f9429df8e2c7a
.integrity: sha512-X5YPuV3h6mhszzfQJ9aOYAljHvJAv1eGx/7rPCL9CsDH9o3zs/bcJ9V+Ejn27dIaqW2Wcf4KG4jX1oOu8perFQ==
.unpackedSize: 1.5 MB
dependencies:
@openui5/sap.m: 1.113.0 @openui5/sap.ui.core: 1.113.0 @openui5/sap.ui.layout: 1.113.0
maintainers:
- randombyte <r@ndombyte.net>
- openui5-bot <ui5-bot+npm-openui5-bot@sap.com>
dist-tags:
latest: 1.113.0
published 5 days ago by openui5-bot <ui5-bot+npm-openui5-bot@sap.com>
npm is working well behind the proxy after i setting the proxy config in npmrc.
Thanks 👍🏻 Although the configuration is read by UI5 Tooling and passed to pacote (the library npm uses to download packages) it doesn't seem that the proxy configuration is considered.
I'm currently trying to figure out whats wrong there and will keep you posted.
From the code, I noticed that we don't pass the https-proxy
to pacote: https://github.com/SAP/ui5-project/blob/0733cdaf18658897058a24ce1278c4051693dd51/lib/ui5Framework/npm/Registry.js#L71
However, there's no public documentation on that option in pacote or npm-registry-fetch
From the code, I noticed that we don't pass the
https-proxy
to pacote: https://github.com/SAP/ui5-project/blob/0733cdaf18658897058a24ce1278c4051693dd51/lib/ui5Framework/npm/Registry.js#L71However, there's no public documentation on that option in pacote or npm-registry-fetch
We do pass the option but only log some options. I will debug to see why it is not picked up and compare it with how npm does it.
@zouyi100 I've pushed a PR that should solve the issue. To be sure that this was a regression, could you please verify whether the behaviour worked before with @ui5/cli v3.0.0? You can use this command to install exactly that version in openui5-sample-app:
npm install -D -E @ui5/cli@3.0.0
Reopening until the proposed fix has been released and to get additional feedback from @zouyi100
Hi @matz3 I have tested by using 3.0.0 which working well behind the proxy.
Thanks a lot @zouyi100 for providing your feedback and opening this issue.
Hi @flovogt I think we need keep this ticket open until the new release on npm. Now the latest version is still v3.1.0 which i guess not include this fix. (Still show error when use 3.1.0)
True. Thanks @zouyi100 I thought we have already triggered a release.
The fix is included in @ui5/cli v3.1.1
Working well with v3.1.1. Thank you, team! 👍
Expected Behavior
Download packages successfully.
Current Behavior
Now i'm working behind a http proxy in company. i have a .npmrc file to set the https-proxy and proxy.
In project level, i can run
npm i
and download the package successfully. But when i runnpm run start
->ui5 serve -o index-dev.html --verbose
, it will be failed when auto download the ui5 dependencies defined in ui5.yaml.Steps to Reproduce the Issue
npm i
(success)npm run start
gotui5 serve --verbose
got