When using "npmClient": "yarn", we expect all npm-related tasks to use yarn instead, including lerna run.
lerna run uses npm, as seen here:
https://github.com/lerna/lerna/blob/master/src/NpmUtilities.js#L132-L153
Some unexpected consequences is that npm's run logging output is more verbose, always outputting extra noise in the log, and we can't pass --silent to it.
> @scope/[email protected] deploy /home/jenkins/workspace/_package-name_PR-917-DVIENVU5LI2MDCVW7HMFTLAJ5QZFKT4IRPA2XDKLB2TTU46VAJLQ/web/modules
> cli run-deploy
Replace "npm" with
const cmd = npmClient || "npm";
And then each run instance, use cmd instead.
ChildProcessUtilities.spawnStreaming(
cmd, ["run", script, ...args], opts, pkg.name, callback
);
Indeed, that makes sense! If someone wants to pick this up, it would involve porting over the --npm-client from BootstrapCommand:
https://github.com/lerna/lerna/blob/7dde757d9f788f49ae605f9a7e187326518ae63e/src/commands/BootstrapCommand.js#L39-L44
and then passing to the various runScript* utilities:
https://github.com/lerna/lerna/blob/7dde757d9f788f49ae605f9a7e187326518ae63e/src/NpmUtilities.js#L125-L146
(switching to an options block for those utilities would be preferable to adding Yet Another Function Parameter)
I'm working on PR, should be finished soon
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Indeed, that makes sense! If someone wants to pick this up, it would involve porting over the
--npm-clientfrom BootstrapCommand:https://github.com/lerna/lerna/blob/7dde757d9f788f49ae605f9a7e187326518ae63e/src/commands/BootstrapCommand.js#L39-L44
and then passing to the various
runScript*utilities:https://github.com/lerna/lerna/blob/7dde757d9f788f49ae605f9a7e187326518ae63e/src/NpmUtilities.js#L125-L146
(switching to an options block for those utilities would be preferable to adding Yet Another Function Parameter)