Questions tagged [lerna]

Lerna is a tool designed to help develop JavaScript projects in a single git repo containing multiple related npm packages.

The two primary commands in Lerna are lerna bootstrap and lerna publish.

bootstrap will link dependencies in the repo together. publish will help publish any updated packages.

Related links:

644 questions
6
votes
0 answers

How to automate publish in a CI environment?

We are using lerna to manage a monorepo and we want to automate the publishing process: The developer makes changes in one of the packages in the monorepo The CI detects that changes have been made The CI builds the package, the patch level is…
abnormi
  • 628
  • 1
  • 7
  • 15
6
votes
0 answers

lerna not generating node_module in packages

I have a monorepo with Lerna and typescript with a basic structure - root package.json - packages package-A package.json src package-B package.json src The root package.json tsconfig…
AngularDebutant
  • 1,436
  • 5
  • 19
  • 41
6
votes
0 answers

typescript monorepo "@/*" alias

I'm moving my projects to a monorepo with Lerna and yarn workspace. I managed to setup the basic stuffs but I'm stuck with this issue and can't find similar problem on the web. As you can see on the image below I'm unable to make path alias…
6
votes
0 answers

Force Hoisting Of Package Dependencies In Yarn (v1) Workspace

I have a monorepo containing many packages. It is using yarn(v1) workspaces. One of the packages contains a set of development dependencies (packages/example-dev/@example/dev) that are consumed as a package by applications external to the monorepo.…
Undistraction
  • 42,754
  • 56
  • 195
  • 331
6
votes
1 answer

How do you publish and install a private npm package to GitHub packages as an organisation?

We have a monorepo with a shared package called "@myorganization/common", that is used by both the app and Google cloud functions. Google cloud functions requires that the package is published to a repo to use it, since we do not publish compiled…
Xiiryo
  • 3,021
  • 5
  • 31
  • 48
6
votes
2 answers

How to use lint-staged in a lerna monorepo to run the same command in all packages?

I have the following root package.json: { "name": "project", "private": true, "workspaces": [ "packages/*" ], "scripts": { "build": "lerna run build", "dev": "lerna run start --stream --parallel", "format": "yarn prettier…
user13103906
6
votes
1 answer

Is there a way to tell lerna/npm to 'really look in my own node_modules for those peer dependencies'?

I have a fairly standard lerna monorepo that will look like this: packages/ main/ - This is the main deployable application, it depends on both dep and react-dep dep/ - Just some pure functions, no problems here react-dep/ - A design…
dwjohnston
  • 11,163
  • 32
  • 99
  • 194
6
votes
1 answer

Yarn workspace + lerna is creating node_modules in each sub-package

I have a monorepo which I'm managing with yarn workspaces + lerna. From what I understand, running yarn should create a node_modules directory at the root of the project but not in each individual package. I was following a tutorial where the author…
Mark
  • 9,718
  • 6
  • 29
  • 47
6
votes
1 answer

Is there any way to avoid symlinking in monorepo built with yarn workspaces and lerna?

Lets say there is a monorepo with package A and B. Package A is dependent on B. Package B is also published in npm registry. So when installing dependencies it does not install the package B from npm registry instead it symlinks to the local package…
tofaelahmed
  • 101
  • 7
6
votes
1 answer

Bump root package.json version with lerna

When I call lerna version 1.0.0 it bumps the versions to 1.0.0 for every package that has changed in the /packages dir. Additionally, I'd like to bump the version of the root package.json. I'm basically trying to do the following in a single…
Matt K
  • 4,813
  • 4
  • 22
  • 35
6
votes
2 answers

What is a correct approach to a javascript monorepo

I'm trying to figure out correct approach for a javascript monorepo. Imagine monorepo containing packages / libraries: root - node_modules - packages + lib-a * node_modules + lib-b * node_modules Now let's say…
user3056783
  • 2,265
  • 1
  • 29
  • 55
6
votes
1 answer

When I run serve command with lerna I got enormous of outputs rows

Im using lerna to run serve command. this command call vue/cli which call webpack to analyze all the files and build the bundle. So I run lerna run serve --stream in vue/cli application and I get output of lot of rows in webpack progress: myapp-vue:…
Jon Sud
  • 10,211
  • 17
  • 76
  • 174
6
votes
3 answers

The lerna build is very slow, always (+30 minutes)

I'm just joining a new VueJS / Webpack based on a Lerna code architecture : package.json lerna.json packages/ modules/ plugins/ Approximately each page of the application has been set as a separated module which I find strange and although not an…
Ludo
  • 71
  • 1
  • 4
6
votes
0 answers

React-native app inside lerna package

I'm trying to create a new react native application inside a lerna package structure, but I'm getting the following error: $ react-native init app This will walk you through creating a new React Native project in…
Mendes
  • 17,489
  • 35
  • 150
  • 263
6
votes
1 answer

with lerna monorepo, how to reference different versions of a shared package?

New to lerna and monorepo, my understanding is with lerna, we put all shared packages and all consumer packages in a single repo. Then after 'lerna bootstrap', consumer1 and consumer2 will both have a local link to shared1 (symllink). So whenever I…
Nan Li
  • 603
  • 1
  • 7
  • 18