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.

v3.18.0: `--hoist` no longer accepts multiple string values (yargs v14 change)

See original GitHub issue

Expected 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)

  1. 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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
evocateurcommented, Oct 18, 2019

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?

lerna bootstrap --ignore-scripts --no-ci --hoist `{rollup,postcss-cli,webpack-cli,babel-loader,npm-run-all}`

Alternatively, specify this list in your lerna.json:

{
  "command": {
    "bootstrap": {
      "hoist": [
        "rollup",
        "postcss-cli",
        "webpack-cli",
        "babel-loader",
        "npm-run-all"
      ]
    }
  },
  ...
}
1reaction
evocateurcommented, Oct 21, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Additional documentation - yargs - JS.ORG
The coercion function should accept one argument, representing the parsed value from the command line (an array if multiple values are parsed for...
Read more >
@lerna/validation-error | Yarn - Package Manager
command: GitUtilities.isInitialized no longer exists. You shouldn't be using GitUtilities. publish: Many named exports of GitUtilities are no longer provided.
Read more >
Open Source Used In Stealthwatch Enterprise (official) 7.3.2
Cisco has more than 200 offices worldwide. ... 1.30 hoist-non-react-statics 3.3.1 ... 1.768 graphql ^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0 || ^14.0.0....
Read more >
Third-party software dependencies | Elastic Cloud Enterprise ...
Library Version Optional/Required Packaged akka‑actor_2.12 2.6.18 Required Yes akka‑http‑core_2.12 10.2.7 Required Yes akka‑http‑json4s_2.12 1.27.0 Required Yes
Read more >
Compare Versions | @elliemae/pui-cli | npm
GHSA-hj9c-8jmm-8c52Packing does not respect root-level ignore files in ... @svgr/babel-plugin-replace-jsx-attribute-value 5.0.1 ... @types/yargs 15.0.14.
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found