question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add multiple packages in a single command

See original GitHub issue

Expected Behavior

The following command would allow a user to add the bar and baz packages to the foo package.

lerna add --scope=foo bar baz

Current Behavior

Currently you can only add one package at a time. To achieve the goal of the previous example, you must run the following.

lerna add --scope=foo bar
lerna add --scope=foo baz

Context

It’s quite common to install multiple npm packages as dependencies.

npm i -D eslint eslint-config-standard eslint-plugin-standard eslint-plugin-node eslint-plugin-import eslint-plugin-promise eslint-plugin-react
npm i -D @babel/core @babel/preset-env @babel/preset-react
npm i -D react react-dom redux react-redux react-router-dom
npm i -D webpack webpack-cli webpack-dev-server babel-loader file-loader css-loader style-loader

Intuitively, lerna should also allow this behavior.

#1608 was opened to request this feature, but no discussion came from it. The result was essentially “lerna doesn’t do this” and the reason given was vague.

The ambiguity of targets forced a simplification of logic.

I’m not sure what that is supposed to mean, but this behavior caught me out the first time I tried to use lerna because I just expected it to work like npm.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:66
  • Comments:20

github_iconTop GitHub Comments

17reactions
dustinlacewellcommented, Apr 11, 2021

Pls fix…

15reactions
lazarljubenoviccommented, May 2, 2020

Jesus the error message when you try to add multiple packages is so cryptic, it took me ages to find out what’s wrong.

Hopefully writing the error message here helps someone googling: “No packages found where can be added.”

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add multiple packages in single command in flutter
I can do the job by simply adding those packages in pubspec.yaml file and then in command line write this command flutter pub...
Read more >
How to install multiple npm packages with one command
The npm install command is used to install npm packages to a node_modules/ folder. ... You can also install a specific version of...
Read more >
If I try to install multiple packages with one "apt" command, it is ...
You would solve it by using the command plainly without the extra options and having the correct sources for your distribution.
Read more >
Installing multiple nuget packages in one command - Medium
One of my problems with nuget is that I can't install multiple packages in one command while we can do the same in...
Read more >
Managing packages - Conda
To install multiple packages at once, such as SciPy and cURL: ... on a specific package in your environment, there is not one...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found