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-dependency-path with npm to a subfolder does not work

See original GitHub issue

Description: cache-dependency-path to a subfolder results in Error: Some specified paths were not resolved, unable to cache dependencies.

Action version:

actions/setup-node@v3

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

The node 16.x version with corresponding npm version you get in Github.

node-version: 16 check-latest: true

Repro steps:

Repo structure:

<git root>
├── docs
│   └── README.md
├── firebase.json
└── functions
    ├── jest.config.ts
    ├── lib
    ├── node_modules
    ├── package.json
    ├── package-lock.json
    ├── src
    ├── tsconfig.json
    └── tsconfig.prod.json

Relevant workflow part:

jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      - name: setup node
        uses: actions/setup-node@v3
        with:
          node-version: 16
          check-latest: true
          cache: "npm"
          cache-dependency-path: "${ GITHUB_WORKSPACE }/functions/package-lock.json"

But for cache-dependency-path I’ve also tried these strings:

  • “functions/package-lock.json”
  • “./functions/package-lock.json”
  • “*/package-lock.json”

And they all fail:

Environment details
/opt/hostedtoolcache/node/16.18.0/x64/bin/npm config get cache
/home/runner/.npm
Error: Some specified paths were not resolved, unable to cache dependencies.

Expected behavior:

Caching to work even though the package lock file is in a subfolder called functions.

Actual behavior:

See repro steps above.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
dsamecommented, Nov 15, 2022

Hello @kentlarsson, thanks for you input. We start to investigate the issue.

0reactions
dsamecommented, Dec 20, 2022

@kentlarsson @edimossilva i am going to close this issue because of not activity for more than a week, but please feel free to reopen it or create new one in case if the issue exists.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to specifiy path for actions/setup-node in Github
You can try specifying '**/package-lock.json' in the cache-dependency-path (it didn't work for me with other patterns).
Read more >
Run your Github Actions jobs from a specific directory
I am working on a current project where the Backend and the Frontend of the application are on the same repository of Github....
Read more >
Subfolders as Dependencies | Better world by better software
Imagine an NPM project when one file requires another file, maybe in a different directory. We have to use a relative path.
Read more >
Move to subfolder not working for one or more users ( ONLY)
Answer. PROBLEM. Routing to one or more users' sub-folders as an action in GFI MailEssentials works for most, but not all mailboxes.
Read more >
nodejs-fs-utils
There are 36 other projects in the npm registry using nodejs-fs-utils. ... function (err, size) { // callback code }); // don't stop ......
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