yarn install --mutex network:42424 --non-interactive
lerna ERR! yarn install --mutex network:42424 --non-interactive exited 1 in 'selenium-ide-extension'
Probably the reason is in https://github.com/lerna/lerna/blob/master/src/NpmUtilities.js#L66.
I assume that lerna is running more than one node_modules installation in parallel.
Yarn may fail if it runs yarn install
in multiple processes because they may be reading/writing to common cache folder.
A way around is to run yarn with --mutex network
option.
But be mindful to run with a non default port otherwise top level Yarn with --mutex network
will never allow this script to start.
Sounds like --mutex network:<nonDefaultPort>
(docs) is the ticket.
Concurrency
and --mutex
When running multiple instances of yarn as the same user on the same server, you can ensure only one instance runs at any given time (and avoid conflicts) by passing the global flag --mutex
followed by file
or network
.
When using file
Yarn will write/read a mutex file .yarn-single-instance
in the current working directory by default. You can also specify an alternate or global filename.
--mutex file
--mutex file:/tmp/.yarn-mutex
When using network
Yarn will create a server at port 31997
by default. You can also specify an alternate port.
--mutex network
--mutex network:30330
Verbose output
with --verbose
Running yarn <command> --verbose
will print verbose info for the execution (creating directories, copying files, HTTP requests, etc.).