Skip to content
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

fix: use npmrc for legacy-peer-deps when available #6880

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jacobparis
Copy link
Contributor

@jacobparis jacobparis commented Mar 7, 2025

If I'm using npm with React 19, the CLI asks me to use either --legacy-peer-deps or --force

> npx shadcn@latest add calendar                     
✔ Checking registry.
  Installing dependencies.

It looks like you are using React 19. 
Some packages may fail to install due to peer dependency issues in npm (see https://ui.shadcn.com/react-19).

How would you like to proceed?
  › Use --force
  › Use --legacy-peer-deps

These flags aren't required if I have a .npmrc file that sets them as a default, so this PR updates the CLI to check for that

> npx shadcn add calendar
✔ Checking registry.
⠹ Installing dependencies.
Using npm config: --legacy-peer-deps
✔ Installing dependencies.
? The file button.tsx already exists. Would you like to overwrite? › (y/N)

The relevant config is available in npm config list --json so this will match whatever npm is going to use.

Copy link

vercel bot commented Mar 7, 2025

@jacobparis is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

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

Successfully merging this pull request may close these issues.

1 participant