SAP / cloud-mta-build-tool

Multi-Target Application (MTA) build tool for Cloud Applications https://sap.github.io/cloud-mta-build-tool
Apache License 2.0
141 stars 61 forks source link

custom builder with npm install from provided registry is not working #779

Closed AdithyaPrabhu closed 4 years ago

AdithyaPrabhu commented 4 years ago

Do you want to request a feature or report a bug? report a bug

Please provide the following info:

Steps to Reproduce: For one of the modules in our project, I want to download one package[@sap/credential-store-client-node] from a separate registry. I was not able to achieve this using .npmrc file. So, I tried the following options for that module in mta.yaml -

` build-parameters: ignore: [ "./node_modules/", "./test/"] builder: custom commands:

the mtar file is being built successfully. But when I try to deploy it to cf, it fails. As per logs it is an npm 404 error. It is not looking in the provided registry [http://nexus.wdf.sap.corp:8081/nexus/content/groups/build.releases.npm], but it is searching in the default registry where the package is not present.

tal-sapan commented 4 years ago

Hi,

This should be possible with an .npmrc file. What was the problem when you tried the .npmrc and how did you define it?

Best regards, Tal

AdithyaPrabhu commented 4 years ago

Hello Tal,

The .npmrc file is as below-

@sap:registry=http://nexus.wdf.sap.corp:8081/nexus/content/groups/build.releases.npm registry=https://registry.npmjs.org/

I tried placing it at the module level [same level as the corresponding package.json] and at the application level. But both give the same error

`#2.0#2020 09 10 10:55:47.554#Z#DEBUG#com.sap.cloud.lm.sl.xs2.eaee1235-f352-11ea-8603-eeee0a9ff0b2.apim-ax-systemsvc.stageAppTask#

org.cloudfoundry.multiapps.controller.persistence.services.ProcessLogger########flowable-async-job-executor-thread-6044

[PollStageAppStatusExecution] [apim-ax-systemsvc] 3b38e655-7152-4250-a41a-38eb77eb0a06 [Thu Sep 10 10:55:35 UTC 2020] npm ERR! 404 '@sap/cf-securestore-client@4.1.0' is not in the npm registry. (STDOUT, STG)#

2.0#2020 09 10 10:55:47.554#Z#DEBUG#com.sap.cloud.lm.sl.xs2.eaee1235-f352-11ea-8603-eeee0a9ff0b2.apim-ax-systemsvc.stageAppTask

org.cloudfoundry.multiapps.controller.persistence.services.ProcessLogger########flowable-async-job-executor-thread-6044

[PollStageAppStatusExecution] [apim-ax-systemsvc] 3b38e655-7152-4250-a41a-38eb77eb0a06 [Thu Sep 10 10:55:35 UTC 2020] npm ERR! 404 (STDOUT, STG)#

2.0#2020 09 10 10:55:47.554#Z#DEBUG#com.sap.cloud.lm.sl.xs2.eaee1235-f352-11ea-8603-eeee0a9ff0b2.apim-ax-systemsvc.stageAppTask

org.cloudfoundry.multiapps.controller.persistence.services.ProcessLogger########flowable-async-job-executor-thread-6044

[PollStageAppStatusExecution] [apim-ax-systemsvc] 3b38e655-7152-4250-a41a-38eb77eb0a06 [Thu Sep 10 10:55:35 UTC 2020] npm ERR! 404 Not Found - GET https://npm.sap.com/@sap%2fcf-securestore-client (STDOUT, STG)#

2.0#2020 09 10 10:55:47.554#Z#DEBUG#com.sap.cloud.lm.sl.xs2.eaee1235-f352-11ea-8603-eeee0a9ff0b2.apim-ax-systemsvc.stageAppTask

org.cloudfoundry.multiapps.controller.persistence.services.ProcessLogger########flowable-async-job-executor-thread-6044

[PollStageAppStatusExecution] [apim-ax-systemsvc] 3b38e655-7152-4250-a41a-38eb77eb0a06 [Thu Sep 10 10:55:35 UTC 2020] npm ERR! code E404 (STDOUT, STG)#`

Best Regards, Adithya

tal-sapan commented 4 years ago

Hi,

Could you run npm install at the module folder and check if you get the same error?

It looks like you have another npm registry defined for @sap prefix according to this log: ERR! 404 Not Found - GET https://npm.sap.com/@sap%2fcf-securestore-client You can check your npm configuration and where each value is defined by running: npm config list

Best regards, Tal

AdithyaPrabhu commented 4 years ago

Hi Tal, npm config list at the module folder yielded this -

@sap:registry = "http://nexus.wdf.sap.corp:8081/nexus/content/groups/build.releases.npm"
registry = "https://registry.npmjs.org/"

I am not sure where https://npm.sap.com repo is being configured. Is this the default repo?

tal-sapan commented 4 years ago

You can check the default by running npm config ls -l

katunin-ng commented 4 years ago

Hi,

There is no activity for 2 weeks. I assume the issue is not reproducible anymore. If needed please reopen the ticket.

Regards Natalia