v3.18.0: `--hoist` no longer accepts multiple string values (yargs v14 change)
See original GitHub issueExpected Behavior
The bootstrap command should run and host the included packages as per a previous version:
lerna bootstrap --ignore-scripts --no-ci --hoist {rollup,postcss-cli,webpack-cli,babel-loader,npm-run-all}
lerna notice cli v3.16.4 lerna info versioning independent lerna info Bootstrapping 10 packages lerna info Installing external dependencies lerna info hoist Finished bootstrapping root lerna info Symlinking packages and binaries lerna success Bootstrapped 10 packages
Current Behavior
$ npx lerna --version 3.18.1
lerna bootstrap --ignore-scripts --no-ci --hoist {rollup,postcss-cli,webpack-cli,babel-loader,npm-run-all}
ERR! lerna Unknown arguments: postcss-cli, webpack-cli, babel-loader, npm-run-all npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @project-styleguide/project-styleguide@ lerna:bootstrap: `lerna bootstrap --ignore-scripts --no-ci --hoist {rollup,postcss-cli,w ebpack-cli,babel-loader,npm-run-all} npm ERR! Exit status 1
Possible Solution
Not sure, seems like the globbing method has been changed so it only accepts the first argument.
Steps to Reproduce (for bugs)
- As above.
lerna.json
"lerna": "2.11.0",
"packages": [
"packages/*"
],
"version": "independent",
"npmClient": "npm",
"command": {
"bootstrap": {
"npmClientArgs": ["--no-package-lock"]
},
"version": {
"allowBranch": ["releases"]
}
}
}
lerna-debug.log
<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->
Context
We had to roll back the version.
Your Environment
Executable | Version |
---|---|
lerna --version |
3.18.1 |
npm --version |
6.4.1 |
yarn --version |
n/a |
node --version |
10.14.2 |
OS | Version |
---|---|
Oracle linux | 7.6 |
–> |
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Oops, bitten by a yargs change from v12 to v14. Dang. (Also,
--hoist
is a criminally overloaded option, supporting boolean, string, and multiple strings, and this was probably inevitable).What happens if you quote the glob?
Alternatively, specify this list in your lerna.json:
Technically, it used to work when the shell auto-expanded a bracketed list (
{foo,bar,baz} == "foo bar baz"
) due to what I assume was a bug with the Yargs parser. The--hoist
option has always been severely overloaded, and it was only a matter of time before our dirty hacks ran afoul of parser correctness.I would appreciate a PR that documents this wrinkle (proposing the alternatives you’ve moved towards). I don’t think we should spend any time hacking Yargs to “understand” our mutant usage.