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
1,259

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!

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?