-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
.yarnrc.yml
for Yarn, via create-astro
?
#4851
Comments
Oh, just realized I'm using node v18, I'll check with node v16.17, just in case... Edit: everything I wrote above is true for node v16 as well, with the exception of:
Edit 2: Whoops, that was with yarn 1.22.19, |
🙌 Ha, I was just about to open a PR to add
Interesting! |
Can this be closed when #4842 is merged then? |
Yes, this can be closed by |
What version of
astro
are you using?latest
What package manager are you using?
Yarn (for testing purpose, otherwise pnpm)
What operating system are you using?
MacOS
Describe the Bug
All of the templates (/examples/) include
.npmrc
files (e.g.) that contain:This doesn't seem to be necessary anymore?
npm create astro@latest -- --directory temp --template docs --install 0 --git 0 --typescript base cd temp rm .npmrc pnpm install pnpm run dev
... But probably I'm missing something. Anyway, the rest of this was written under the assumption that pnpm still needs
.npmrc
, so let's go with that...For Yarn, we have a Using Astro with Yarn 2+ (Berry) section in the Troubleshooting guide (added in withastro/docs#749), which suggests creating a
yarnrc.yml
(missing initial dot, should be.yarnrc.yml
, PR to fix) that contains:So right now, there's a file to support pnpm that is cruft for npm & yarn (which doesn't bother me, I'm on a pnpm kick at the moment!). Maybe we should do the same for Yarn? Or neither, see option (B) below.
A) Do the same for Yarn 2+ users: Add
.yarnrc.yml
to all of the templates. Yarn users likely outnumber pnpm users.B) Remove the
.npmrc
files from the templates, and extendcreate-astro
to create.yarnrc.yml
if invoked by Yarn (already detected and used to install dependencies), or.npmrc
if invoked by pnpm.Alternate solution for Yarn (source), put the following in
.yarnrc.yml
:I tested this locally.
yarn create astro
is failing for me locally (I'll open an issue), so I usednpm create astro@latest -- --directory temp2 --template docs --install 0 --git 0 --typescript base
to make the project, then made a.yarnrc.yml
with the content above, then I was able to runyarn
&yarn dev
without issue.Edit: weird, this seems to be viable when using node v18, but not with node v16 (both with yarn 3.2.3), I'll double-check that later.
All of the above tested with node v18.9.0, npm 8.19.1, corepack 0.14.0, yarn 3.2.3, pnpm 7.11.0, MacOS 12.3, ARM64.
Edit: Also tested with node v16.17.0, npm 8.15.0, corepack 0.12.1, yarn 3.2.3, pnpm 7.11.0, MacOS 12.3, ARM64.
Link to Minimal Reproducible Example
n/a
Participation
The text was updated successfully, but these errors were encountered: