Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove dependency from nested Lerna Package

I have a lerna setup with n packages located under packages/. Let us take an example where one of the packages uses express where the others do not.

How can I remove express from this package in a lerna-aware manner so the root package.json is updated?

I can add packages with lerna add --scope but it seems there is no corresponding remove functionality.

like image 736
Ray Booysen Avatar asked Aug 28 '18 03:08

Ray Booysen


People also ask

How do I delete a dependency in Lerna?

Currently there's no way to remove a dependency from a lerna package, the closest way we can do is to manually remove from package. json , lerna clean --yes --scope=xxx + lerna bootstrap --scope=xxx . This command provides the remove dependency feature. Just like npm uninstall or yarn remove .

What does lerna publish do?

Lerna is a monorepo manager for JavaScript projects. It helps you take a large codebase and split it into independently deployable packages. Lerna handles every step in the release process — from downloading dependencies, and linking packages together, to testing and publishing updated packages to the NPM registry.


1 Answers

Just remove the packages from your package.json

then run

$lerna bootstrap

like image 178
manuelBetancurt Avatar answered Sep 20 '22 16:09

manuelBetancurt