actions / setup-node

Set up your GitHub Actions workflow with a specific version of node.js
MIT License
3.94k stars 1.3k forks source link

Error: Some specified paths were not resolved, unable to cache dependencies #694

Closed rajat1saxena closed 1 year ago

rajat1saxena commented 1 year ago

Description: I have a Github action to deploy as Astro site to Github Pages. Recently, it has been failing with the following error.

Error: Some specified paths were not resolved, unable to cache dependencies.

I think it is coming due to the fact that setup-node is trying to locate the cache inside apps/docs folder but since it is a monorepo, it is located two levels up.

From the job run, I noticed this:

cache-dependency-path: ./apps/docs/yarn.lock

There is no yarn.lock inside apps/docs since this is a monorepo.

Action version: v3

Platform:

Runner type:

Tools version:

Node 16.19 Yarn 3.2.0

Repro steps:
See the Github job: https://github.com/codelitdev/courselit/actions/runs/4132972124/jobs/7142310620

Expected behavior: It should not throw an error.

Actual behavior: An error is thrown.

rajat1saxena commented 1 year ago

This was related to the withastro Github action.

DakkuaDev commented 10 months ago

It happens to me the same. I am trying to deploy my site with GitHub pages using Astro and GitHub Actions. The Action failed in the same as you. What was the solution to this problem? Thanks

Dan-Finan commented 9 months ago

It happens to me the same. I am trying to deploy my site with GitHub pages using Astro and GitHub Actions. The Action failed in the same as you. What was the solution to this problem? Thanks

Hi @DakkuaDev, did you manage to get around this yet? Struggling with this too!

lemilonkh commented 8 months ago

@Dan-Finan in my case the package-lock.json file was in .gitignore, so not part of the repository. The setup-node action was trying to access the package-lock.json file but it wasn't pushed to the repo.

thrishank commented 3 months ago

@lemilonkh thanks man your solution worked for me. Remove package-lock.json file from .env guys