Remove dependency from nested Lerna Package

  1. Remove package from package.json
  2. Remove node_modules folder: rm -rf packages/{package_name}/node_modules
  3. Run lerna bootstrap

Without step 2 the package still exists in the package-lock.json NPM lock file.


If you want to be sure that lerna bootstrap only updates the specific package-lock.json in @org-name/package-name/ and not other package-lock.json files, do:

  1. Manually remove dependencies from @org-name/package-name/package.json

  2. Run:

lerna bootstrap --scope @org-name/package-name --no-ci --force-local

Just remove the packages from your package.json

then run

$lerna bootstrap