Reputation: 11
I am using Lerna (https://github.com/lerna/lerna) for managing my monorepo with the following structure:
-yarn.lock
-package.json
-node_modules
-packages
--app
---app1
----package.json
----src
----dist
(The above structure is the minimal example I could give, actual project has many more sub repos but this is the only one that's built on Jenkins.)
On my local machine with Yarn and NPM version as follows:
yarn: 1.22.10
node: v12.14.1
I run the following commands to build my APP1 from my root directory
yarn
cd ./packages/app/app1
yarn build
which generates dist folder in packages/app/app1.
But when I run the same set of commands on Jenkins I get the following error:
error No lockfile in this directory. Run yarn install to generate one.
error Command failed with exit code 1.
Since I'm using lerna, my lockfile is in root directory. Why am I getting this error? Why not on local machine?
Node and Yarn versions on Jenkins:
yarn: 1.9.10
node: v12.16.1
Upvotes: 1
Views: 3679