SAP / jenkins-library

Jenkins shared library for Continuous Delivery pipelines.
https://www.project-piper.io
Apache License 2.0
769 stars 583 forks source link

npmExecuteScripts fails with ENOWORKSPACES #4929

Open navinkrishnan opened 1 month ago

navinkrishnan commented 1 month ago

Hi, In the project package.json, I have configured workspaces

 "workspaces": [
    "app/*"
  ]

In the pipeline config, I have the following for npmExecuteScripts

  npmExecuteScripts: 
    install: true
    publish: false
    runScripts: 
      - "production-build"

This results in the error:

info  npmExecuteScripts - Discovered package.json file package.json
12:14:56  info  npmExecuteScripts - running command: npm config get registry
12:14:56  error npmExecuteScripts - npm ERR! code ENOWORKSPACES
12:14:56  error npmExecuteScripts - npm ERR! This command does not support workspaces.
12:14:56  info  npmExecuteScripts - 
12:14:56  error npmExecuteScripts - npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-05-15T06_44_55_325Z-debug-0.log
anilkeshav27 commented 2 weeks ago

the npm build does not support workspaces currently

navinkrishnan commented 1 week ago

Hi @anilkeshav27 , how do we handle project with workspaces. The above error is not for the script I wanted to run, but rather npmExecuteScripts automatically runs the command npm config get registry and it fails.

js1972 commented 1 day ago

This is bad news. The best practice that is developing for CAP/UI5 apps is to use npm workspaces as it allows the CAP tooling to work alongside the UI5 tooling. And now our CICD service can't handle it. Is there a workaround to this?