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.

`cache: yarn` doesn't work for a self hosted runner

See original GitHub issue

In the documentation, there is a section called Caching packages dependencies, which suggests to use cache: yarn for caching yarn dependencies.

On GitHub runners, it works, since GitHub runners have both node and yarn already installed, and therefore there is no problem. On self-hosted runner, this is not a case.

Which leads us to a catch-22 situation: setup-node action actually expects node to be installed (together with yarn).

Therefore, the action itself fails (since it cannot run yarn during setup).

My proposal is maybe to actually install yarn during the action, at least if we need it for action to success.

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

10reactions
yhaskellcommented, Aug 7, 2021

So, basically the idea is to not use setup node to set up node on the self hosted runners?

8reactions
yhaskellcommented, Sep 15, 2021

Basically, I have to install node, to be able to install node. That sounds counterintuitive, and wrong

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to cache yarn packages in GitHub Actions - Stack Overflow
Solution 3: Caching node_modules with actions/cache (NOT recommended) · yarn is good at utilizing global cache. If the dependencies are already ...
Read more >
GitHub Actions — Solving actions/cache@v2 for self-hosted ...
In this story, I am going to present an alternative solution to actions/cache Github action. This solution is mostly for self-hosted runners ......
Read more >
Questions & Answers | Yarn - Package Manager
A list of answers to commonly asked questions.
Read more >
Pipeline caching - Azure - Microsoft Learn
On the first run after the task is added, the cache step will report a "cache miss" since the cache identified by this...
Read more >
Yarn caching doesn't work - Visual Studio Feedback
Please check if the “YARN_CACHE_FOLDER” variable is valid. You also could try to use the other kinds of agents , for example: Windows-2019...
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