cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BTP CI/CD fail in Additional Test - Error: running command 'npm' failed

former_member13323
Participant
0 Kudos

Hi there,

When running CI/CD for my test CAP Build, I'm getting the following error:

[2023-11-27T02:41:38.133Z] ----------------------------------------------------------
[2023-11-27T02:41:38.133Z] --- An error occurred in the library step: dockerExecute
[2023-11-27T02:41:38.133Z] ----------------------------------------------------------
[2023-11-27T02:41:38.133Z] 
[2023-11-27T02:41:38.133Z] The following parameters were available to the step:
[2023-11-27T02:41:38.133Z] ***
[2023-11-27T02:41:38.133Z] *** to show step parameters, set verbose:true in general pipeline configuration
[2023-11-27T02:41:38.133Z] *** WARNING: this may reveal sensitive information. ***
[2023-11-27T02:41:38.133Z] ***
[2023-11-27T02:41:38.133Z] 
[2023-11-27T02:41:38.133Z] The error was:
[2023-11-27T02:41:38.133Z] ***
[2023-11-27T02:41:38.133Z] hudson.AbortException: [npmExecuteScripts] Step execution failed (category: build). Error: running command 'npm' failed: cmd.Run() failed: exit status 1
[2023-11-27T02:41:38.133Z] ***
[2023-11-27T02:41:38.133Z] <br>

Relevant mta.yaml npm build as follows:


Manually running "npm run test" in VSCode it's all good.

Not sure where it went wrong? Any help appreciated thanks!

chgeo
Advisor
Advisor
0 Kudos

The error log is truncated and does not show the full error. Please attach the full log.

Pro tip: always attach full logs. Screenshots usually do not help, except for UI related issues.

former_member13323
Participant
0 Kudos

christian.georgi Here you go log.txt

yogananda
Product and Topic Expert
Product and Topic Expert
0 Kudos
sammok83

Seems like log.txt doesn't have much info to your issue. Might be wrong file you have attached.

former_member13323
Participant
0 Kudos

yoganandamuthaiah That's the full log

build-acef4650-59de-4b96-83bc-9553e84555aa.txt (I've uploaded it again and renamed it to txt). I'm not sure what else I would have to attach?

former_member13323
Participant
0 Kudos

If you look at the log file closely, you'd find it here:

yogananda
Product and Topic Expert
Product and Topic Expert
0 Kudos
sammok83

disable the additional unit test scenario and run it again

former_member13323
Participant
0 Kudos

Of course it works without the test scenario. The point is having it work with it.

Accepted Solutions (0)

Answers (1)

Answers (1)

LindaSieb
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

It looks like there's a problem with running the command "npm config get registry", which happens before your test script is called. "npm config" apparently does not support workspaces. See documentation here: https://docs.npmjs.com/cli/v9/commands/npm-config#:~:text=Note%3A%20This%20command%20is%20unaware%20.... Hence the "ENOWORKSPACES" and "This command does not support workspaces." errors.

From looking online I see that it may help to add a file to your repository called .npmrc and state in there what the registry should be (My source: https://github.com/vercel/turbo/issues/4183#issuecomment-1468147866). The contents of the file could be "registry=https://registry.npmjs.org/" (without the quotation marks).

Could you please try that and see if it helps?

Best regards,

Linda Siebert

former_member13323
Participant
0 Kudos

Thanks lindasieb , but it didn't work - I've got the same error. Also tried adding npx next telemetry disable in the build parameters > before-all > command of the mta.yaml file, but got the same error (As referenced from your link).

LindaSieb
Product and Topic Expert
Product and Topic Expert
0 Kudos

sammok83 could you attach the package.json file that you are using?