yarn run: Execute Scripts
yarn run executes your defined scripts with local bins on PATH.
Like npm run, yarn run is the CI entry point for build/test/lint. Yarn lets you omit run for non-reserved script names.
Common usage
yarn run <script>oryarn <script>yarn <script> <args>- forwards args (no--needed in Berry)yarn run env- inspect environment
Example in CI
Run the build script.
shell
yarn buildIn CI
A non-zero script exit fails the job. In Yarn Berry args after the script name are forwarded directly to the tool.
Key takeaways
yarn <script>is shorthand foryarn run.- Berry forwards args without
--. - Non-zero exit fails CI.