2

Assume I have a microservice A and a microservice (implemented on node.js) B which both depends on package C.

When I release my application (which includes A,B and C) I want to make sure that the same version of C is used by both A and B. I want this to be the case whenever I release A or B during development.

In fact with Java and Maven there is the concept of a BOM (bill of materials) see for example, which solves this for Java.

Maven BOM [Bill Of Materials] Dependency

Is there a similar solution for node.js?

kohlerm
  • 2,596
  • 1
  • 17
  • 22
  • What are you using as a dependency manager? [Yarn](https://yarnpkg.com/lang/en/) generates [yarn.lock](https://yarnpkg.com/lang/en/docs/yarn-lock/) file to fix the package version. So all you need is a yarn.lock at the root to ensure that the module version remains same – Suhail Gupta Sep 27 '17 at 11:37
  • ATM its npm but I'm still open to switch to yarn. Yes I like the yarn.lock fil approach, but I'm not sure how it would work because my microservices are in separate repositories. – kohlerm Sep 27 '17 at 12:55
  • You would need to have same `yarn.lock` in the two repositories. This will ensure the same versions across the repo. Here is the [doc](https://yarnpkg.com/lang/en/docs/migrating-from-npm/) – Suhail Gupta Sep 27 '17 at 14:26

0 Answers0