2

I've got a monorepo with roughly the following structure (npm modules):

myProject
|-base
|-ui1
|-ui2

In the base module I have all the stuff combined which my ui1 and ui2 projects use commonly. I use npm local paths to add the base module as a dependency to the ui-projects.

...
"dependencies": {
   ...
   "base": "file:../base"
   ...
}
...

So far so good...

In my CI environment (Jenkins) I use npm ci to install the dependencies. Since these steps are executed parallelly, the node_modules folder of base will be deleted by the npm ci call of ui1 while ui2 is trying to install the dependencies as well. This causes random errors of course...

Now my actual question: Is there a way to tell npm ci not to delete the node_modules of path dependencies? Of course any other hint to solve this kind of problem is appreciated as well... ;)

Thanks a lot for your help!

nioe
  • 756
  • 1
  • 7
  • 15

0 Answers0