07-13-2021 9:40 AM - edited 02-04-2024 1:46 AM
Hi,
I wanted to re-build a successfully deployed cap project (after implementing small adjustments) but it fails now.
I'm using an mta.yaml file. Before I can deploy it, I have to build it: building fails.
To me it seems that SAP is currently adding/changing dependencies in the cds package.
I get the following error:
INFO executing the "npx -p @sap/cds-dk cds build --production" command...
........npm ERR! code E404
npm ERR! 404 Not Found - GET http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/@sap/cds/-/cds-5...
npm ERR! 404
npm ERR! 404 '@sap/cds@5.3.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of '@sap/cds-dk'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
Yesterday I got an error for a missing lint package, also noted as a dependency of sap/cds-dk. Since today that seems no problem anymore but now there is a different package missing, I'm concluding that SAP is currently working on dependencies of sap/cds-dk.
Can you please confirm and if I'm correct, when do you think everything will be 'buildable' again?
Thank you in advance
Daniel
Hi Daniel,
Sorry, I needed to revise my answer after I saw that you use BAS.
"npx" always downloads the newest version. And new versions have just been released. At least that explains what have changed. But as said, for me it works both local and on BAS in the EU trial landscape (hanatrial.ondemand.com), which should be the same as EU10.
Looks like BAS' npm proxy doesn't resolve it for whatever reason.
Please open a ticket if the issue persists.
Maybe you can try a:
npm cache clean --force
Or go with the pre-installed @sap/cds-dk version (call without the npx) until the issue is resolved.
Best regards,
Uwe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Uwe,
npm cache clean --force
unfortunately didn't help.
I'm not sure about calling it without 'npx': I actually just right click on the mta.yaml and choose 'Build MTA Project' - I guess everything else is then done automatically.
Since the change is not that urgent, I will wait a few days and open a ticket if the issue persists.
Thanks again for your quick replies!
Have a nice day & BR
Daniel
Using the pre-installed @sap/cds-dk version works for me!
Hi,
For anyone encountering this issue and needs a quick workaround, change the following line from mta.yaml, under commands of build-parameters:
- npx -p @sap/cds-dk cds build --production
To use the node_modules directory installed in your project:
- node_modules/@sap/cds-dk/bin/cds.js build --production
It seems this has already been fixed, no need for the workaround. Please see Boris' answer.
Hi,
It's is not recommended to change the default setting for npm registry manually.
BAS implements internal caching mechanism for NPM and Maven packages. The cache is updated every 24 hours with new package versions.
Following this thread we changed the cache update interval to 30 minutes and this problem should not occur anymore.
Best Regards,
Boris
Product Owner
Business Application Studio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This worked for me:
npm config set @sap:registry https://npm.sap.com
Somehow seems to point npm in the right direction.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is not advised to use https://npm.sap.com anymore as all publicly available SAP packages are available in the public NPM registry now.
This is not advised.
1. All SAP packages are available on https://www.npmjs.com/
2. In this approach you disable BAS caching mechanism for all @sap namespace.
Regards,
Boris
Hi Boris,
would you then advise to do something like this?
npm config set @sap:registry https://www.npmjs.com/
Because right now i get "undefined" back if i try to read the parameter by:
npm config get @sap:registry
The proposed solution to remove "npx" in the build parameters in mta doesn't work for me, since I played around with re-installing all dependencies - with the result that I don't have the module in question in my node_modules directory locally.
So right now I'm not able to build and deploy new changes of an existing (and deployed) cap project.
erik_pross89 thanks for this, I can also confirm the behaviour with new CAP projects (no files are getting created), mentioned by you in the other reply.
Thank you
Daniel
npm.sap.com redirects to https://registry.npmjs.org/
Guessing it doesn't really make a big difference then.
@boris.tsirulnik ... disabling the BAS cache was the whole point, because it was not up to date and withheld us from building our applications for more than a day.
This has happened more than just this once.
Is there any way to force the BAS repo cahce to refresh? That would then be a better solution.
But I'm not going to sit around for 2 days waiting for it to happen.
We changed the cache interval to 30 minutes.
Let me know if you still have a problem when disabling manual registry set.
Hi Daniel,
I am still getting the same issue in BAS while doing "mbt build" . Although I tried "npm cache clean --force", it didnt work for me. As a workaround, do I need to change the registry to https://registry.npmjs.org ? Just wanted to make sure that there is no impact on deployment after doing so.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Navneet,
I can confirm this, I'm also still getting the same error.
As a workaround I did the following:
Since SAP does not suggest to set the registry parameter (some caching mechanism breaks) I created a new DEV space. When everything is working again I will switch back to my original DEV space.
BR Daniel
Hi Daniel.
I think instead of using a complete other environment (although that is extra safe), I think you could also unset the variable by using the below command:
npm config delete @sap:registry
Regards,
Erik
Hi Boris,
To answer your questions:
1). I am using Corporate Git system and not any of the SAP samples.
2) BAS is not on trail,its https://xxxxxxxxxxxx.eu10cf.applicationstudio.cloud.sap/index.html#xxxxx
Regards,
Navneet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Team,
I am having the same issue on my SAP internal global account.
It appeared in a workspace which was working fine 2 days ago.
It looks like the following command does solve the issue:
npm config set @sap:registry https://npm.sap.com
But I have to run it each time I restart the workspace.You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello. I'm still getting this error "GET http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/@sap/cds/-/cds-5.3.0.tgz". I can build the project from a trial account and from a local machine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Daniel and Uwe,
I also have a CAP project that (until yesterday 17:30) was building and deploying fine.
After that when I try to build again I get the exact same error you are getting.
Additionally I tried creating a completely new dev space and starting from Git. This has the same result.
After that I tried creating an empty CAP project from template in a new dev space. Now that is not even creating any files anymore (no mta.yaml, no package.json, no db, srv, app folders etc).
It seems something has broken several things in the BAS environment 😞
Regards,
Erik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Daniel,
You can change it in the mta.yaml file.
But its more a workaround then a solution and might not work as well.
Best regards,
Uwe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Uwe,
thank you very much for this ultra fast answer!
I'm not sure how to check that tbh. I'm using BAS and didn't change anything from the standard setup.
I also created a new dev space and cloned the project from the git repository. The result is the same.
Building was working successfully about two weeks ago.
BR Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Daniel,
In the public NPM registry, you can find that version for @sap/cds:
https://www.npmjs.com/package/@sap/cds
You're running it in BAS?
For me it works in the trial landscape.
Please try again and open a ticket if the issue persists.
Best regards,
Uwe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.