Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Yarn arguments #319

Open
arcanis opened this issue Jun 3, 2019 · 7 comments
Open

Yarn arguments #319

arcanis opened this issue Jun 3, 2019 · 7 comments

Comments

@arcanis
Copy link

arcanis commented Jun 3, 2019

Opening an issue here as requested in the support email (I initially asked on Twitter what was the best PoC, and was redirected to the support) 🙂

Yarn 2 doesn't support the --cache-folder command-line option (it always was problematic, because users had to specify it at every single command). This causes a crash on Netlify when using Yarn together with the v2 (currently flagged experimental, fortunately).

Additionally, starting from Yarn 2 we no longer have different logic between the Yarn cache and the offline mirrors. The directory pointed by the cache-folder key will be populated with archives, and as such it becomes possible (and recommended in various situations) to add the cache to the repository (amongst other things, it enables Zero-installs). However, this doesn't work if Netlify configures a different cache location than the default one.

We're currently hitting this issue with the Yarn 2 Netlify instance (example), but it's likely your customers would encounter it as well once we start publishing formal releases. I'd be happy to help find out a solution (I lead Yarn's development) 🙂

@arcanis
Copy link
Author

arcanis commented Jun 5, 2019

@ekfuhrmann This isn't related.

8:58:58 AM: error An unexpected error occurred: "https://registry.yarnpkg.com/lodash.--imagelate/-/lodash.--imagelate-3.6.2.tgz: Request failed \"404 Not Found\"".

@ekfuhrmann
Copy link

@arcanis My mistake!

@arcanis
Copy link
Author

arcanis commented Jun 13, 2019

Ping someone? @bcomnes maybe? 😄

@rybit
Copy link
Member

rybit commented Jun 13, 2019

@bcomnes has sadly found a new gig. Sorry for the delay, we are trying to get our internal resources marshaled to be able to properly respond to requests on the image.

@arcanis
Copy link
Author

arcanis commented Jun 13, 2019

No worry 🙂

@ylemkimon
Copy link

ylemkimon commented Aug 3, 2020

The workaround for packages not being cached is setting the environment variable YARN_GLOBAL_FOLDER to /opt/buildhome/.yarn_cache and YARN_ENABLE_GLOBAL_CACHE=1 in Netlify settings. Note this depends on the undocumented path in

: ${NETLIFY_BUILD_BASE="/opt/buildhome"}
if yarn install --cache-folder $NETLIFY_BUILD_BASE/.yarn_cache ${yarn_local:+"$yarn_local"}
so it may break in the future.

@camjackson
Copy link

Looks like @ylemkimon has fixed this issue in #465. @rybit do you think it's likely to be merged?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants