Skip to content

Conversation

@HiDeoo
Copy link
Member

@HiDeoo HiDeoo commented Apr 18, 2025

Changes

When running the latest version of create-astro with pnpm, I'm getting the following error:

▲  error Error
▲  error Dependencies failed to install, please run pnpm install to install them manually after setup.
✔  Project initialized!
■ Template copied
■ Dependencies installed

After adding some logging, the underlying issue seems to be:

ERR_PNPM_MISSING_PACKAGE_NAME  `pnpm add` requires the package name

In #13395, the install() function was updated to use pnpm add instead of pnpm install without a changeset so it ended up being released 2 days ago with version 4.11.2. This PR reverts that change.

The install() function seems to only be meant to install all dependencies (and never a single package) so I'm not sure if there is a reason I'm potentially missing for the change or not.

Testing

I tested locally using node create-astro.mjs but I don't know how to force a specific package manager with this method so I temporarily hardcoded pnpm. Without the fix, I properly reproduced the error. After the fix, the issue seems to be resolved.

Looks like most of the tests for create-astro are using dryRun: true so not sure if/how we should add a test for this.

Docs

This is a bug fix that does not require any documentation change.

@changeset-bot
Copy link

changeset-bot bot commented Apr 18, 2025

🦋 Changeset detected

Latest commit: a957478

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: create-astro Related to the `create-astro` package (scope) label Apr 18, 2025
@ematipico ematipico merged commit c5af903 into withastro:main Apr 23, 2025
14 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Apr 23, 2025
openscript pushed a commit to openscript/astro that referenced this pull request Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: create-astro Related to the `create-astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants