Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move cache out of node_modules #842

Closed
jaredpalmer opened this issue Mar 8, 2022 · 6 comments
Closed

Move cache out of node_modules #842

jaredpalmer opened this issue Mar 8, 2022 · 6 comments

Comments

@jaredpalmer
Copy link
Contributor

Describe the feature you'd like to request

node_modules is a bad default place for the cache because most CI/CDs will blow out node_modules whenever the lockfile changes. The cache also currently grows in an unbounded manner.

Describe the solution you'd like

Use tmp directory

On macOS and Linux consider using tmp.

  • Pro: automatically clean up and not let the cache grow unbounded
  • Con: hard to inspect from VSCode
  • Con: hard to cache, will require custom flag to change position in CI so it is cacheable (--cache-dir=.turbo)

Use .turbo at the root

  • Pro: easy to inspect locally
  • Pro: no needed to change location in ci w/flag

Hybrid of both?

Use tmp on macOS when run in interactive shell, use .turbo in CI?

Describe alternatives you've considered

n/a

@fz6m
Copy link

fz6m commented Mar 9, 2022

I think ${root}/.turbo is better

  1. In github actions: .turbo can be easily cached (see next.js)

  2. Local check: When there is a problem with the cache, can delete it for check

@jlarmstrongiv
Copy link

jlarmstrongiv commented Mar 9, 2022

Agree with @fz6m keep the turbo cache in the project folder please

@belgattitude
Copy link

Some thoughts, I'd prefer a .cache/turbo. But .turbo is fantastic

@weyert
Copy link
Contributor

weyert commented Mar 11, 2022

I would prefer the root of the project or an optional to configure where it should go

@miszo
Copy link

miszo commented Mar 12, 2022

I would opt for the Use .turbo at the root option. It is easier to inspect locally and cache on CI.

@kevin-secrist
Copy link

Would be nice to specify the cache directory in turbo.json, in a similar way that yarn/npm allow you to change the package cache location in their config files. Seems like this would be a reasonable way to implement the feature without causing a breaking change. For caching in CI I've had to put --cache-dir .turbo in all calls to turbo, but it would be nice to avoid that by either specifying an env var or (preferably) putting it in the config file so it also applies to local development.

@vercel vercel locked and limited conversation to collaborators Feb 22, 2024
@anthonyshew anthonyshew converted this issue into discussion #7497 Feb 22, 2024
@linear linear bot changed the title Move cache outside of node_modules Move cache out of node_modules May 10, 2024
@linear linear bot added the breaking label May 10, 2024
@linear linear bot reopened this May 10, 2024
@linear linear bot assigned anthonyshew and unassigned nathanhammond May 10, 2024
@linear linear bot closed this as completed May 17, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

10 participants