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
139 stars 61 forks source link

npm registry-entry not correct used inside from monorep-modules #1110

Open hh4711 opened 7 months ago

hh4711 commented 7 months ago

Hi,

by creating a monorep-project with using of other internal modules, which are only stored in the private npm (Azure DevOps), then it is not possible to integrate an common-npm 'common' (private) on a lower level.

With npm install in the integrated monorep-module 'm1', the common-module 'common' is installed (with help from .npmrc).

With npm install on the main monorepo-module 'main', the common-module could be installed too (with help from .npmrc on the main-module level).

But by 'mbt build' the main monorep-module, the monorep module 'm1' leads to an error, because the 'common' module is not found. On the main-module level the .npmrc is working and deliver the correct internal registry. But on the 'm1' module level, the .npmrc (on main level) is not used and then the common-module will be searched in the standard https://registry.npmjs.org, but could not be found. In my case it was a fiori-app to build.

Steps to Reproduce:

  1. Create a common module
  2. Create a fiori app
  3. npm publish in e.g. Azure Devops (not to npmjs.org)
  4. Use common module in a monorepo module
  5. npm publish in e.g. Azure Devops (not to npmjs.org)
  6. Use monorepo module in a main module
  7. Create a mta.yaml
  8. run mbt build
yutaoj commented 7 months ago

Hi @hh4711 ,
could you share a simple yaml file which may reproduce this issue ? thanks Yutao