lerna: Cannot delete property '--' of #
I exec lerna exec -- npm view \$LERNA_PACKAGE_NAME
, then an error appears:
$ lerna -v
3.18.4
$ lerna exec -- npm view \$LERNA_PACKAGE_NAME
/<proj>/node_modules/yargs/yargs.js:1184
else throw err
^
TypeError: Cannot delete property '--' of #<Object>
at Object.Yargs.self._copyDoubleDash (/<proj>/node_modules/yargs/yargs.js:1196:5)
at Object.parseArgs [as _parseArgs] (/<proj>/node_modules/yargs/yargs.js:1097:60)
at Object.parse (/<proj>/node_modules/yargs/yargs.js:578:25)
at main (/<proj>/node_modules/lerna/index.js:44:6)
at Object.<anonymous> (/<proj>/node_modules/lerna/cli.js:11:15)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19)
Expected Behavior
No error
Current Behavior
The error
Possible Solution
Maybe from yargs 14.2.1
Steps to Reproduce (for bugs)
- create an empty respository
- yarn init
- yarn global add lerna
- lerna exec – npm view $LERNA_PACKAGE_NAME
lerna.json
<!-- Please paste your `lerna.json` here -->
no lerna.json
lerna-debug.log
<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->
no lerna-debug.log
Context
Your Environment
Executable | Version |
---|---|
lerna --version |
3.18.4 |
npm --version |
6.11.3 |
yarn --version |
1.12.1 |
node --version |
v12.12.0 |
OS | Version |
---|---|
MacOS Mojave | 10.14.6 |
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 19
- Comments: 16 (2 by maintainers)
Commits related to this issue
- chore(tests): Use exact lerna version to work around https://github.com/lerna/lerna/issues/2348 — committed to invertase/react-native-firebase by Salakar 5 years ago
- fix: downgrade and lock lerna version for workaround - see https://github.com/lerna/lerna/issues/2348 — committed to aquariuslt/blog by aquariuslt 5 years ago
- fix(command): Do not mutate `argv` parameter See https://github.com/babel/babel/pull/10733 for details. Fixes #2348 — committed to lerna/lerna by evocateur 5 years ago
- fix: downgrade and lock lerna version for workaround - see https://github.com/lerna/lerna/issues/2348 Former-commit-id: af148f6198433681f502ea49312d7062178c9bea — committed to aquariuslt/blog by aquariuslt 5 years ago
- fix: downgrade and lock lerna version for workaround - see https://github.com/lerna/lerna/issues/2348 Former-commit-id: ee0e6a738462bad2bfc6bde8546516b4af340a45 [formerly af148f6198433681f502ea4931... — committed to aquariuslt/blog by aquariuslt 5 years ago
- fix: downgrade and lock lerna version for workaround - see https://github.com/lerna/lerna/issues/2348 Former-commit-id: f83304f466552ec7b94ccc006080267e691ceeac [formerly ee0e6a738462bad2bfc6bde854... — committed to aquariuslt/blog by aquariuslt 5 years ago
- fix: downgrade and lock lerna version for workaround - see https://github.com/lerna/lerna/issues/2348 — committed to aquariuslt/blog by aquariuslt 5 years ago
- perf: [ImgBot] Optimize images (#1076) * chore(release): 6.0.2 [skip ci] ## [6.0.2](https://github.com/aquariuslt/blog/compare/v6.0.1...v6.0.2) (2019-10-21) ### Bug Fixes * **renderer:** add... — committed to aquariuslt/blog by imgbot[bot] 3 years ago
@samarpanB I tried downgrading lerna in my package.json to 3.17.0 , and it DID work for me. This is what that line looks like.
Ditto,
Downgrading to the following works for me for now:
Seems introduced from: https://github.com/yargs/yargs/pull/1459
The document should be updated if this is intended: https://github.com/lerna/lerna/tree/master/commands/exec#usage Then it’s a break change.
@samarpanB make sure you correctly pin the version in your
package.json
as"3.17.0"
and not"^3.17.0"
.also make sure to clear out your
node_modules
and re-run a cleannpm install
(oryarn
, if that’s what you use)I’m getting this with
lerna run
as well when trying to pass args to the underlying npm script with lerna v3.18.4.lerna run start --scope some-package -- -c someoption
results in:
Thanks @Robinnnnn Downgrading to 3.17.0 and pinning the same in package.json solves the issue for me
Same here. can someone sugest a workaround here ? Our builds are failing. Downgrading to version 3.17 also didnt work